From d4c68bf905f2b7d61d699901db4f9e41998afe05 Mon Sep 17 00:00:00 2001 From: Alexey Akhunov Date: Fri, 13 Jul 2018 08:43:24 +0100 Subject: [PATCH] miner: Concurrent read/write during contract deployment (issue #16933) --- miner/worker.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/miner/worker.go b/miner/worker.go index ff48ecabc3..ee7506d70f 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -316,7 +316,9 @@ func (self *worker) wait() { for _, log := range work.state.Logs() { log.BlockHash = block.Hash() } + self.currentMu.Lock() stat, err := self.chain.WriteBlockWithState(block, work.receipts, work.state) + self.currentMu.Unlock() if err != nil { log.Error("Failed writing block to chain", "err", err) continue