From 2b9f16802d22b8d743797aecc9bd040a38d6f1f4 Mon Sep 17 00:00:00 2001 From: Maran Date: Fri, 18 Jul 2014 12:01:26 +0200 Subject: WIP to expose hashrate to gui --- ethereal/gui.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'ethereal') diff --git a/ethereal/gui.go b/ethereal/gui.go index 9a65ff3d0..8047db63e 100644 --- a/ethereal/gui.go +++ b/ethereal/gui.go @@ -7,6 +7,7 @@ import ( "github.com/ethereum/eth-go/ethchain" "github.com/ethereum/eth-go/ethdb" "github.com/ethereum/eth-go/ethlog" + "github.com/ethereum/eth-go/ethminer" "github.com/ethereum/eth-go/ethpub" "github.com/ethereum/eth-go/ethutil" "github.com/ethereum/eth-go/ethwire" @@ -40,6 +41,8 @@ type Gui struct { Session string clientIdentity *ethwire.SimpleClientIdentity config *ethutil.ConfigManager + + miner *ethminer.Miner } // Create GUI, but doesn't start it @@ -124,6 +127,7 @@ func (gui *Gui) ToggleMining() { txt = "Start mining" } else { utils.StartMining(gui.eth) + gui.miner = utils.GetMiner() txt = "Stop mining" } @@ -346,6 +350,10 @@ func (gui *Gui) update() { case <-peerChan: gui.setPeerInfo() case <-ticker.C: + if gui.miner != nil { + pow := gui.miner.GetPow() + fmt.Println("HashRate from miner", pow.GetHashrate()) + } gui.setPeerInfo() } } -- cgit