mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-24 00:39:26 +00:00
miner: copy pending state before handing it to callers (#3162)
The pending state was not copied while not mining, leading to a data race.
This commit is contained in:
parent
5b262ff5ab
commit
c9471e7782
1 changed files with 1 additions and 1 deletions
|
|
@ -169,7 +169,7 @@ func (self *worker) pending() (*types.Block, *state.StateDB) {
|
||||||
self.current.txs,
|
self.current.txs,
|
||||||
nil,
|
nil,
|
||||||
self.current.receipts,
|
self.current.receipts,
|
||||||
), self.current.state
|
), self.current.state.Copy()
|
||||||
}
|
}
|
||||||
return self.current.Block, self.current.state.Copy()
|
return self.current.Block, self.current.state.Copy()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue