aboutsummaryrefslogtreecommitdiffstats
path: root/miner
diff options
context:
space:
mode:
Diffstat (limited to 'miner')
-rw-r--r--miner/agent.go4
-rw-r--r--miner/worker.go4
2 files changed, 6 insertions, 2 deletions
diff --git a/miner/agent.go b/miner/agent.go
index 6865d5a08..64491e04c 100644
--- a/miner/agent.go
+++ b/miner/agent.go
@@ -79,3 +79,7 @@ func (self *CpuMiner) mine(block *types.Block) {
self.returnCh <- Work{block.Number().Uint64(), nonce, mixDigest, seedHash}
}
}
+
+func (self *CpuMiner) GetHashRate() int64 {
+ return self.pow.GetHashrate()
+}
diff --git a/miner/worker.go b/miner/worker.go
index 63d1bfa0b..ae6782aca 100644
--- a/miner/worker.go
+++ b/miner/worker.go
@@ -57,7 +57,7 @@ type Agent interface {
SetWorkCh(chan<- Work)
Stop()
Start()
- Pow() pow.PoW
+ GetHashRate() int64
}
type worker struct {
@@ -272,7 +272,7 @@ func (self *worker) commitTransaction(tx *types.Transaction) error {
func (self *worker) HashRate() int64 {
var tot int64
for _, agent := range self.agents {
- tot += agent.Pow().GetHashrate()
+ tot += agent.GetHashRate()
}
return tot