From 26aea736736dc70257b1c11676f626ab775e9339 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jano=C5=A1=20Gulja=C5=A1?= Date: Thu, 7 Feb 2019 11:40:36 +0100 Subject: cmd, node, p2p/simulations: fix node account manager leak (#19004) * node: close AccountsManager in new Close method * p2p/simulations, p2p/simulations/adapters: handle node close on shutdown * node: move node ephemeralKeystore cleanup to stop method * node: call Stop in Node.Close method * cmd/geth: close node.Node created with makeFullNode in cli commands * node: close Node instances in tests * cmd/geth, node: minor code style fixes * cmd, console, miner, mobile: proper node Close() termination --- cmd/swarm/main.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'cmd/swarm/main.go') diff --git a/cmd/swarm/main.go b/cmd/swarm/main.go index 53888b615..11b51124d 100644 --- a/cmd/swarm/main.go +++ b/cmd/swarm/main.go @@ -288,6 +288,7 @@ func bzzd(ctx *cli.Context) error { if err != nil { utils.Fatalf("can't create node: %v", err) } + defer stack.Close() //a few steps need to be done after the config phase is completed, //due to overriding behavior @@ -365,6 +366,8 @@ func getPrivKey(ctx *cli.Context) *ecdsa.PrivateKey { if err != nil { utils.Fatalf("can't create node: %v", err) } + defer stack.Close() + return getAccount(bzzconfig.BzzAccount, ctx, stack) } -- cgit v1.2.3