diff options
author | Péter Szilágyi <peterke@gmail.com> | 2016-12-13 20:03:18 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2016-12-13 20:04:05 +0800 |
commit | dadd68935935388b158a510c95b8644be44073ce (patch) | |
tree | 43f2d101c1665756693e8dc3d7a95f76862ebd03 /miner/worker.go | |
parent | b750cab56a724b2ff0bff3fab0849cb776a4f392 (diff) | |
download | go-tangerine-dadd68935935388b158a510c95b8644be44073ce.tar go-tangerine-dadd68935935388b158a510c95b8644be44073ce.tar.gz go-tangerine-dadd68935935388b158a510c95b8644be44073ce.tar.bz2 go-tangerine-dadd68935935388b158a510c95b8644be44073ce.tar.lz go-tangerine-dadd68935935388b158a510c95b8644be44073ce.tar.xz go-tangerine-dadd68935935388b158a510c95b8644be44073ce.tar.zst go-tangerine-dadd68935935388b158a510c95b8644be44073ce.zip |
miner: fix data race on setting etherbase/extradata
Diffstat (limited to 'miner/worker.go')
-rw-r--r-- | miner/worker.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/miner/worker.go b/miner/worker.go index 5fa7c4115..fdc6b7d8e 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -161,6 +161,12 @@ func (self *worker) setEtherbase(addr common.Address) { self.coinbase = addr } +func (self *worker) setExtra(extra []byte) { + self.mu.Lock() + defer self.mu.Unlock() + self.extra = extra +} + func (self *worker) pending() (*types.Block, *state.StateDB) { self.currentMu.Lock() defer self.currentMu.Unlock() |