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.
This commit is contained in:
@ -48,9 +48,10 @@ type RemoteAgent struct {
|
||||
}
|
||||
|
||||
func NewRemoteAgent() *RemoteAgent {
|
||||
agent := &RemoteAgent{work: make(map[common.Hash]*Work), hashrate: make(map[common.Hash]hashrate)}
|
||||
|
||||
return agent
|
||||
return &RemoteAgent{
|
||||
work: make(map[common.Hash]*Work),
|
||||
hashrate: make(map[common.Hash]hashrate),
|
||||
}
|
||||
}
|
||||
|
||||
func (a *RemoteAgent) SubmitHashrate(id common.Hash, rate uint64) {
|
||||
@ -75,8 +76,12 @@ func (a *RemoteAgent) Start() {
|
||||
}
|
||||
|
||||
func (a *RemoteAgent) Stop() {
|
||||
close(a.quit)
|
||||
close(a.workCh)
|
||||
if a.quit != nil {
|
||||
close(a.quit)
|
||||
}
|
||||
if a.workCh != nil {
|
||||
close(a.workCh)
|
||||
}
|
||||
}
|
||||
|
||||
// GetHashRate returns the accumulated hashrate of all identifier combined
|
||||
|
Reference in New Issue
Block a user