aboutsummaryrefslogtreecommitdiffstats
path: root/miner
diff options
context:
space:
mode:
authorJeffrey Wilcke <geffobscura@gmail.com>2015-07-07 16:58:47 +0800
committerJeffrey Wilcke <geffobscura@gmail.com>2015-07-07 16:58:47 +0800
commit37c1a8f69de44827a60296342189b6719a49dbc3 (patch)
treed889b5d451f3bfb532177a59389be40ded8cac91 /miner
parent35cd355c14d9a5266a7d4b11127d25eb7f961494 (diff)
downloaddexon-37c1a8f69de44827a60296342189b6719a49dbc3.tar.gz
dexon-37c1a8f69de44827a60296342189b6719a49dbc3.tar.zst
dexon-37c1a8f69de44827a60296342189b6719a49dbc3.zip
eth,miner,rpc: set coinbase
Diffstat (limited to 'miner')
-rw-r--r--miner/miner.go5
-rw-r--r--miner/worker.go6
2 files changed, 11 insertions, 0 deletions
diff --git a/miner/miner.go b/miner/miner.go
index 7f73f3ee8..83f7c4503 100644
--- a/miner/miner.go
+++ b/miner/miner.go
@@ -137,3 +137,8 @@ func (self *Miner) PendingState() *state.StateDB {
func (self *Miner) PendingBlock() *types.Block {
return self.worker.pendingBlock()
}
+
+func (self *Miner) SetEtherbase(addr common.Address) {
+ self.coinbase = addr
+ self.worker.setEtherbase(addr)
+}
diff --git a/miner/worker.go b/miner/worker.go
index 840609721..7be41118c 100644
--- a/miner/worker.go
+++ b/miner/worker.go
@@ -124,6 +124,12 @@ func newWorker(coinbase common.Address, eth core.Backend) *worker {
return worker
}
+func (self *worker) setEtherbase(addr common.Address) {
+ self.mu.Lock()
+ defer self.mu.Unlock()
+ self.coinbase = addr
+}
+
func (self *worker) pendingState() *state.StateDB {
self.currentMu.Lock()
defer self.currentMu.Unlock()