aboutsummaryrefslogtreecommitdiffstats
path: root/miner/miner.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-10-29 20:28:00 +0800
committerFelix Lange <fjl@twurst.com>2015-10-30 00:26:26 +0800
commitfbdb44dcc17240a01b45e55d3aa4e4b8db0868cd (patch)
tree2363ce8738074226cfedf8ede1612e0ef3a03494 /miner/miner.go
parent56f8699a6c6bfe613d2ab28c47631a1f4a29e36f (diff)
downloadgo-tangerine-fbdb44dcc17240a01b45e55d3aa4e4b8db0868cd.tar.gz
go-tangerine-fbdb44dcc17240a01b45e55d3aa4e4b8db0868cd.tar.zst
go-tangerine-fbdb44dcc17240a01b45e55d3aa4e4b8db0868cd.zip
cmd/utils, rpc/comms: stop XEth when IPC connection ends
There are a bunch of changes required to make this work: - in miner: allow unregistering agents, fix RemoteAgent.Stop - in eth/filters: make FilterSystem.Stop not crash - in rpc/comms: move listen loop to platform-independent code Fixes #1930. I ran the shell loop there for a few minutes and didn't see any changes in the memory profile.
Diffstat (limited to 'miner/miner.go')
-rw-r--r--miner/miner.go7
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