Merge pull request #969 from Gustav-Simonsson/ethash_improve_hashrate_update2

Make read of ethash hashrate atomic and update ethash godep
This commit is contained in:
Jeffrey Wilcke
2015-05-14 04:05:27 -07:00
5 changed files with 48 additions and 116 deletions

View File

@ -175,7 +175,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)
}
@ -459,13 +458,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