miner, rpc: added submit hashrate for remote agents

This commit is contained in:
Jeffrey Wilcke
2015-08-06 11:58:14 +02:00
parent 82ef26f600
commit c32073b11f
4 changed files with 85 additions and 4 deletions

View File

@ -139,8 +139,15 @@ func (self *Miner) Mining() bool {
return atomic.LoadInt32(&self.mining) > 0
}
func (self *Miner) HashRate() int64 {
return self.pow.GetHashrate()
func (self *Miner) HashRate() (tot int64) {
tot += self.pow.GetHashrate()
// do we care this might race? is it worth we're rewriting some
// aspects of the worker/locking up agents so we can get an accurate
// hashrate?
for _, agent := range self.worker.agents {
tot += agent.GetHashRate()
}
return
}
func (self *Miner) SetExtra(extra []byte) {