diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-10-30 00:42:55 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-10-30 00:42:55 +0800 |
commit | fc46cf337af614f4f9c96acd222089652fe7c76e (patch) | |
tree | 672ce52e11b768801f0b33f224424ba5f0fdc465 /miner/miner.go | |
parent | fd27f074feecec2f1e4c8041ff04ddac8d0ab6a3 (diff) | |
parent | fbdb44dcc17240a01b45e55d3aa4e4b8db0868cd (diff) | |
download | go-tangerine-fc46cf337af614f4f9c96acd222089652fe7c76e.tar go-tangerine-fc46cf337af614f4f9c96acd222089652fe7c76e.tar.gz go-tangerine-fc46cf337af614f4f9c96acd222089652fe7c76e.tar.bz2 go-tangerine-fc46cf337af614f4f9c96acd222089652fe7c76e.tar.lz go-tangerine-fc46cf337af614f4f9c96acd222089652fe7c76e.tar.xz go-tangerine-fc46cf337af614f4f9c96acd222089652fe7c76e.tar.zst go-tangerine-fc46cf337af614f4f9c96acd222089652fe7c76e.zip |
Merge pull request #1946 from fjl/xeth-oom
Fix for xeth OOM issue
Diffstat (limited to 'miner/miner.go')
-rw-r--r-- | miner/miner.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/miner/miner.go b/miner/miner.go index 769db79d1..6d4a84f1a 100644 --- a/miner/miner.go +++ b/miner/miner.go @@ -133,10 +133,13 @@ func (self *Miner) Register(agent Agent) { if self.Mining() { agent.Start() } - self.worker.register(agent) } +func (self *Miner) Unregister(agent Agent) { + self.worker.unregister(agent) +} + func (self *Miner) Mining() bool { return atomic.LoadInt32(&self.mining) > 0 } @@ -146,7 +149,7 @@ func (self *Miner) HashRate() (tot int64) { // 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 { + for agent := range self.worker.agents { tot += agent.GetHashRate() } return |