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
This commit is contained in:
Janoš Guljaš
2019-02-07 11:40:36 +01:00
committed by Péter Szilágyi
parent 81801ccc2b
commit 26aea73673
16 changed files with 111 additions and 13 deletions

View File

@ -192,6 +192,12 @@ func NewNode(datadir string, config *NodeConfig) (stack *Node, _ error) {
return &Node{rawStack}, nil
}
// Close terminates a running node along with all it's services, tearing internal
// state doen too. It's not possible to restart a closed node.
func (n *Node) Close() error {
return n.node.Close()
}
// Start creates a live P2P node and starts running it.
func (n *Node) Start() error {
return n.node.Start()