This commit is contained in:
Illya Havsiyevych 2017-04-22 17:15:53 +00:00 committed by GitHub
commit 1a176a4291
2 changed files with 5 additions and 2 deletions

View file

@ -384,7 +384,7 @@ func (pool *TxPool) promoteTx(addr common.Address, hash common.Hash, tx *types.T
// Set the potentially new pending nonce and notify any subsystems of the new tx // Set the potentially new pending nonce and notify any subsystems of the new tx
pool.beats[addr] = time.Now() pool.beats[addr] = time.Now()
pool.pendingState.SetNonce(addr, tx.Nonce()+1) pool.pendingState.SetNonce(addr, tx.Nonce()+1)
go pool.eventMux.Post(TxPreEvent{tx}) pool.eventMux.Post(TxPreEvent{tx})
} }
// Add queues a single transaction in the pool if it is valid. // Add queues a single transaction in the pool if it is valid.

View file

@ -202,10 +202,13 @@ func (s *TypeMuxSubscription) deliver(event *TypeMuxEvent) {
} }
// Otherwise deliver the event // Otherwise deliver the event
s.postMu.RLock() s.postMu.RLock()
defer s.postMu.RUnlock() go deliver_goroutine(s, event)
}
func deliver_goroutine(s *TypeMuxSubscription, event *TypeMuxEvent) {
select { select {
case s.postC <- event: case s.postC <- event:
case <-s.closing: case <-s.closing:
} }
s.postMu.RUnlock()
} }