diff --git a/core/tx_pool.go b/core/tx_pool.go index 987b43d4a9..3e15d830e4 100644 --- a/core/tx_pool.go +++ b/core/tx_pool.go @@ -394,7 +394,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 pool.beats[addr] = time.Now() 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. diff --git a/event/event.go b/event/event.go index d3e84f0f7f..93ebfc1bed 100644 --- a/event/event.go +++ b/event/event.go @@ -202,10 +202,13 @@ func (s *TypeMuxSubscription) deliver(event *TypeMuxEvent) { } // Otherwise deliver the event s.postMu.RLock() - defer s.postMu.RUnlock() + go deliver_goroutine(s, event) +} +func deliver_goroutine(s *TypeMuxSubscription, event *TypeMuxEvent) { select { case s.postC <- event: case <-s.closing: } + s.postMu.RUnlock() }