good morning!!!!

Skip to content
Snippets Groups Projects
Commit 37c1a8f6 authored by Jeffrey Wilcke's avatar Jeffrey Wilcke
Browse files

eth,miner,rpc: set coinbase

parent 35cd355c
No related merge requests found
......@@ -472,6 +472,7 @@ func (s *Ethereum) Etherbase() (eb common.Address, err error) {
// set in js console via admin interface or wrapper from cli flags
func (self *Ethereum) SetEtherbase(etherbase common.Address) {
self.etherbase = etherbase
self.miner.SetEtherbase(etherbase)
}
func (s *Ethereum) StopMining() { s.miner.Stop() }
......
......@@ -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)
}
......@@ -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()
......
......@@ -19,7 +19,7 @@ var (
"miner_makeDAG": (*minerApi).MakeDAG,
"miner_setExtra": (*minerApi).SetExtra,
"miner_setGasPrice": (*minerApi).SetGasPrice,
"admin_setEtherbase": (*minerApi).SetEtherbase,
"miner_setEtherbase": (*minerApi).SetEtherbase,
"miner_startAutoDAG": (*minerApi).StartAutoDAG,
"miner_start": (*minerApi).StartMiner,
"miner_stopAutoDAG": (*minerApi).StopAutoDAG,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment