aboutsummaryrefslogtreecommitdiffstats
path: root/miner/worker.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2016-12-13 20:03:18 +0800
committerPéter Szilágyi <peterke@gmail.com>2016-12-13 20:04:05 +0800
commitdadd68935935388b158a510c95b8644be44073ce (patch)
tree43f2d101c1665756693e8dc3d7a95f76862ebd03 /miner/worker.go
parentb750cab56a724b2ff0bff3fab0849cb776a4f392 (diff)
downloadgo-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.go6
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()