diff options
author | Nick Johnson <arachnid@notdot.net> | 2016-10-19 04:34:37 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2016-10-19 04:34:37 +0800 |
commit | c9471e778209e16442a530820fb90c01cd47c369 (patch) | |
tree | 66d57d6afeba78ddf7ab23950697e83dc3dc0b9f | |
parent | 5b262ff5aba5309d16f02343b2a41c9afcd459ea (diff) | |
download | go-tangerine-c9471e778209e16442a530820fb90c01cd47c369.tar.gz go-tangerine-c9471e778209e16442a530820fb90c01cd47c369.tar.zst go-tangerine-c9471e778209e16442a530820fb90c01cd47c369.zip |
miner: copy pending state before handing it to callers (#3162)
The pending state was not copied while not mining, leading to a data race.
-rw-r--r-- | miner/worker.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/miner/worker.go b/miner/worker.go index e5348cef4..89064c3b9 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -169,7 +169,7 @@ func (self *worker) pending() (*types.Block, *state.StateDB) { self.current.txs, nil, self.current.receipts, - ), self.current.state + ), self.current.state.Copy() } return self.current.Block, self.current.state.Copy() } |