aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/utils
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 /cmd/utils
parent56f8699a6c6bfe613d2ab28c47631a1f4a29e36f (diff)
downloadgo-tangerine-fbdb44dcc17240a01b45e55d3aa4e4b8db0868cd.tar
go-tangerine-fbdb44dcc17240a01b45e55d3aa4e4b8db0868cd.tar.gz
go-tangerine-fbdb44dcc17240a01b45e55d3aa4e4b8db0868cd.tar.bz2
go-tangerine-fbdb44dcc17240a01b45e55d3aa4e4b8db0868cd.tar.lz
go-tangerine-fbdb44dcc17240a01b45e55d3aa4e4b8db0868cd.tar.xz
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 'cmd/utils')
-rw-r--r--cmd/utils/flags.go11
1 files changed, 4 insertions, 7 deletions
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index c2b92be46..299ab4abb 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -627,17 +627,14 @@ func StartIPC(eth *eth.Ethereum, ctx *cli.Context) error {
Endpoint: IpcSocketPath(ctx),
}
- initializer := func(conn net.Conn) (shared.EthereumApi, error) {
+ initializer := func(conn net.Conn) (comms.Stopper, shared.EthereumApi, error) {
fe := useragent.NewRemoteFrontend(conn, eth.AccountManager())
xeth := xeth.New(eth, fe)
- codec := codec.JSON
-
- apis, err := api.ParseApiString(ctx.GlobalString(IPCApiFlag.Name), codec, xeth, eth)
+ apis, err := api.ParseApiString(ctx.GlobalString(IPCApiFlag.Name), codec.JSON, xeth, eth)
if err != nil {
- return nil, err
+ return nil, nil, err
}
-
- return api.Merge(apis...), nil
+ return xeth, api.Merge(apis...), nil
}
return comms.StartIpc(config, codec.JSON, initializer)