aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2015-10-02 18:39:43 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2015-10-02 18:39:43 +0800
commit0d78f96205685e56ff20f99859538437939950f3 (patch)
treeb0e9c031062c21b3b149e2dce7c85d19210794d1
parent49ae53850622f3ea051184dccc867fbfec4c9ecb (diff)
parenta6cc02f68fb13167b861efa72690538e7cf5b177 (diff)
downloaddexon-0d78f96205685e56ff20f99859538437939950f3.tar
dexon-0d78f96205685e56ff20f99859538437939950f3.tar.gz
dexon-0d78f96205685e56ff20f99859538437939950f3.tar.bz2
dexon-0d78f96205685e56ff20f99859538437939950f3.tar.lz
dexon-0d78f96205685e56ff20f99859538437939950f3.tar.xz
dexon-0d78f96205685e56ff20f99859538437939950f3.tar.zst
dexon-0d78f96205685e56ff20f99859538437939950f3.zip
Merge pull request #1865 from obscuren/deadlock-chainmanager-fix
core: deadlock in chainmanager after posting RemovedTransactionEvent
-rw-r--r--core/chain_manager.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/chain_manager.go b/core/chain_manager.go
index 55ef3fcad..49f831a59 100644
--- a/core/chain_manager.go
+++ b/core/chain_manager.go
@@ -804,7 +804,9 @@ func (self *ChainManager) reorg(oldBlock, newBlock *types.Block) error {
DeleteReceipt(self.chainDb, tx.Hash())
DeleteTransaction(self.chainDb, tx.Hash())
}
- self.eventMux.Post(RemovedTransactionEvent{diff})
+ // Must be posted in a goroutine because of the transaction pool trying
+ // to acquire the chain manager lock
+ go self.eventMux.Post(RemovedTransactionEvent{diff})
return nil
}