Skip to content

Commit b24f16f

Browse files
author
Gustav Simonsson
committed
Make read of ethash hashrate atomic and update ethash godep
1 parent f7fdb4d commit b24f16f

5 files changed

Lines changed: 48 additions & 116 deletions

File tree

‎Godeps/Godeps.json‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Godeps/_workspace/src/github.com/ethereum/ethash/ethash.go‎

Lines changed: 15 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Godeps/_workspace/src/github.com/ethereum/ethash/src/python/core.c‎

Lines changed: 28 additions & 99 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎miner/miner.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func (self *Miner) Register(agent Agent) {
7070
}
7171

7272
func (self *Miner) HashRate() int64 {
73-
return self.worker.HashRate()
73+
return self.pow.GetHashrate()
7474
}
7575

7676
func (self *Miner) SetExtra(extra []byte) {

‎miner/worker.go‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ func (self *worker) stop() {
173173
func (self *worker) register(agent Agent) {
174174
self.mu.Lock()
175175
defer self.mu.Unlock()
176-
177176
self.agents = append(self.agents, agent)
178177
agent.SetReturnCh(self.recv)
179178
}
@@ -453,13 +452,9 @@ func (self *worker) commitTransaction(tx *types.Transaction) error {
453452
return nil
454453
}
455454

455+
// TODO: remove or use
456456
func (self *worker) HashRate() int64 {
457-
var tot int64
458-
for _, agent := range self.agents {
459-
tot += agent.GetHashRate()
460-
}
461-
462-
return tot
457+
return 0
463458
}
464459

465460
// gasprice calculates a reduced gas price based on the pct

0 commit comments

Comments
 (0)