aboutsummaryrefslogtreecommitdiffstats
path: root/miner
diff options
context:
space:
mode:
authorNick Johnson <arachnid@notdot.net>2016-10-19 04:34:37 +0800
committerFelix Lange <fjl@twurst.com>2016-10-19 04:34:37 +0800
commitc9471e778209e16442a530820fb90c01cd47c369 (patch)
tree66d57d6afeba78ddf7ab23950697e83dc3dc0b9f /miner
parent5b262ff5aba5309d16f02343b2a41c9afcd459ea (diff)
downloaddexon-c9471e778209e16442a530820fb90c01cd47c369.tar.gz
dexon-c9471e778209e16442a530820fb90c01cd47c369.tar.zst
dexon-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.
Diffstat (limited to 'miner')
-rw-r--r--miner/worker.go2
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()
}