Skip to content

Commit

Permalink
miner/worker: fix concurrent access too map causing segfault
Browse files Browse the repository at this point in the history
  • Loading branch information
andrepatta committed Sep 13, 2024
1 parent e82ff02 commit b905806
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 @@ -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
Expand Down

0 comments on commit b905806

Please sign in to comment.