From b36dcc7b53f3d765e9de4c8a197e0ea75c34a08b Mon Sep 17 00:00:00 2001 From: Austin Roberts Date: Mon, 16 May 2022 10:56:49 -0500 Subject: [PATCH] Give plugins access to node.Close() Prior to this update, plugins could shutdown Geth by panicking, but had no mechanism to shutdown cleanly. Simply exposing the node.Close() function (which already exists on the Node struct), plugins should be able to initiate a clean shutdown. In general, Plugins should make sparing use of this capability, but in light of the fact that they were able to do unclean shutdowns via a panic(), we can't avoid allowing them to stop Geth, and allowing them to do so cleanly seems better than relying on panics. --- core/interface.go | 1 + 1 file changed, 1 insertion(+) diff --git a/core/interface.go b/core/interface.go index beff886..e6e2ca5 100644 --- a/core/interface.go +++ b/core/interface.go @@ -171,6 +171,7 @@ type Node interface { WSEndpoint() string ResolvePath(x string) string Attach() (Client, error) + Close() error } type Client interface {