From b24f16fa532483e0714700d687f134fb373f2487 Mon Sep 17 00:00:00 2001 From: Gustav Simonsson Date: Thu, 14 May 2015 03:39:07 +0200 Subject: Make read of ethash hashrate atomic and update ethash godep --- miner/miner.go | 2 +- miner/worker.go | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) (limited to 'miner') diff --git a/miner/miner.go b/miner/miner.go index 09342e250..8143fcef7 100644 --- a/miner/miner.go +++ b/miner/miner.go @@ -70,7 +70,7 @@ func (self *Miner) Register(agent Agent) { } func (self *Miner) HashRate() int64 { - return self.worker.HashRate() + return self.pow.GetHashrate() } func (self *Miner) SetExtra(extra []byte) { diff --git a/miner/worker.go b/miner/worker.go index f737be507..4316038d2 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -173,7 +173,6 @@ func (self *worker) stop() { func (self *worker) register(agent Agent) { self.mu.Lock() defer self.mu.Unlock() - self.agents = append(self.agents, agent) agent.SetReturnCh(self.recv) } @@ -453,13 +452,9 @@ func (self *worker) commitTransaction(tx *types.Transaction) error { return nil } +// TODO: remove or use func (self *worker) HashRate() int64 { - var tot int64 - for _, agent := range self.agents { - tot += agent.GetHashRate() - } - - return tot + return 0 } // gasprice calculates a reduced gas price based on the pct -- cgit