From 07cecb1f7bc00ac9343198f97e201f6bb8c6b50a Mon Sep 17 00:00:00 2001 From: Alexey Akhunov Date: Fri, 15 Jun 2018 13:09:54 +0100 Subject: [PATCH] miner: Concurrent read/write during contract depoyment (fixes 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