diff --git a/miner/worker.go b/miner/worker.go index ded36a9b6..45ff41a9f 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -751,7 +751,9 @@ func (w *worker) resultLoop() { logs = append(logs, receipt.Logs...) } // Commit block and state to database. + w.mu.Lock() _, err := w.chain.WriteBlockAndSetHead(block, receipts, logs, task.state, true) + w.mu.Unlock() if err != nil { log.Error("Failed writing block to chain", "err", err) continue