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 hello2mao committed Apr 12, 2019
1 parent 9c0bece commit e1b6511
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions miner/worker.go
Original file line number Diff line number Diff line change
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 e1b6511

Please sign in to comment.