miner: provide coinbase when starting the miner
This avoids having to query the coinbase when creating the miner, which in turn eliminates the dreaded startup error when no accounts are set up. Later, this will also allow us to simply restart the miner when the user picks a different coinbase. This causes a lot of changes in other packages. These are included in this commit because they're impossible to separate.
This commit is contained in:
@ -249,12 +249,14 @@ func (self *jsre) dump(call otto.FunctionCall) otto.Value {
|
||||
}
|
||||
|
||||
func (self *jsre) stopMining(call otto.FunctionCall) otto.Value {
|
||||
self.xeth.Miner().Stop()
|
||||
self.ethereum.StopMining()
|
||||
return otto.TrueValue()
|
||||
}
|
||||
|
||||
func (self *jsre) startMining(call otto.FunctionCall) otto.Value {
|
||||
self.xeth.Miner().Start()
|
||||
if err := self.ethereum.StartMining(); err != nil {
|
||||
return otto.FalseValue()
|
||||
}
|
||||
return otto.TrueValue()
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user