From d7b5a87b3bc4a19677877d3a8c8c925211eb25f1 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Wed, 11 Mar 2015 23:35:34 +0100 Subject: 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. --- cmd/mist/ui_lib.go | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'cmd/mist/ui_lib.go') diff --git a/cmd/mist/ui_lib.go b/cmd/mist/ui_lib.go index 4198c6316..2679e0f95 100644 --- a/cmd/mist/ui_lib.go +++ b/cmd/mist/ui_lib.go @@ -175,22 +175,12 @@ func (self *UiLib) RemoveLocalTransaction(id int) { //self.miner.RemoveLocalTx(id) } -func (self *UiLib) SetGasPrice(price string) { - self.Miner().MinAcceptedGasPrice = ethutil.Big(price) -} - -func (self *UiLib) SetExtra(extra string) { - self.Miner().Extra = extra -} - func (self *UiLib) ToggleMining() bool { - if !self.Miner().Mining() { - self.Miner().Start() - - return true + if !self.eth.IsMining() { + err := self.eth.StartMining() + return err == nil } else { - self.Miner().Stop() - + self.eth.StopMining() return false } } -- cgit