Skip to content

Commit

Permalink
miner: fix state locking while writing to chain (issue ethereum#16933) (
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeyAkhunov authored and karalabe committed Jul 31, 2018
1 parent d6efa69 commit 2fbc454
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions miner/worker.go
Expand Up @@ -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
Expand Down

0 comments on commit 2fbc454

Please sign in to comment.