Skip to content

Commit 0d78f96

Browse files
committed
Merge pull request bnb-chain#1865 from obscuren/deadlock-chainmanager-fix
core: deadlock in chainmanager after posting RemovedTransactionEvent
2 parents 49ae538 + a6cc02f commit 0d78f96

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎core/chain_manager.go‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,9 @@ func (self *ChainManager) reorg(oldBlock, newBlock *types.Block) error {
804804
DeleteReceipt(self.chainDb, tx.Hash())
805805
DeleteTransaction(self.chainDb, tx.Hash())
806806
}
807-
self.eventMux.Post(RemovedTransactionEvent{diff})
807+
// Must be posted in a goroutine because of the transaction pool trying
808+
// to acquire the chain manager lock
809+
go self.eventMux.Post(RemovedTransactionEvent{diff})
808810

809811
return nil
810812
}

0 commit comments

Comments
 (0)