Skip to content

Commit

Permalink
bugfix: do not overwrite block being appended with the pending block
Browse files Browse the repository at this point in the history
  • Loading branch information
kiltsonfire authored and gameofpointers committed Oct 25, 2023
1 parent 10faf69 commit 6dddbf4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -512,13 +512,13 @@ func (w *worker) GeneratePendingHeader(block *types.Block, fill bool) (*types.He
w.current = work

// Create a local environment copy, avoid the data race with snapshot state.
block, err = w.FinalizeAssemble(w.hc, work.header, block, work.state, work.txs, work.unclelist(), work.etxs, work.subManifest, work.receipts)
newBlock, err := w.FinalizeAssemble(w.hc, work.header, block, work.state, work.txs, work.unclelist(), work.etxs, work.subManifest, work.receipts)
if err != nil {
return nil, err
}

work.header = block.Header()
w.printPendingHeaderInfo(work, block, start)
work.header = newBlock.Header()
w.printPendingHeaderInfo(work, newBlock, start)

return work.header, nil
}
Expand Down

0 comments on commit 6dddbf4

Please sign in to comment.