Skip to content

Commit c9471e7

Browse files
Arachnidfjl
authored andcommitted
miner: copy pending state before handing it to callers (bnb-chain#3162)
The pending state was not copied while not mining, leading to a data race.
1 parent 5b262ff commit c9471e7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎miner/worker.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ func (self *worker) pending() (*types.Block, *state.StateDB) {
169169
self.current.txs,
170170
nil,
171171
self.current.receipts,
172-
), self.current.state
172+
), self.current.state.Copy()
173173
}
174174
return self.current.Block, self.current.state.Copy()
175175
}

0 commit comments

Comments
 (0)