From 2755aeec54aa019a75ac67520dd821e48b422279 Mon Sep 17 00:00:00 2001 From: Rafael Sampaio <5679073+r4f4ss@users.noreply.github.com> Date: Wed, 18 Sep 2024 19:22:21 -0300 Subject: [PATCH] Reorder of Close() calls in closePortalRpcServer --- cmd/shisui/main.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cmd/shisui/main.go b/cmd/shisui/main.go index 3bb01f3587..e4d3065dac 100644 --- a/cmd/shisui/main.go +++ b/cmd/shisui/main.go @@ -139,10 +139,6 @@ func handlerInterrupt(clientChan <-chan *Client) { } func (cli *Client) closePortalRpcServer() { - log.Info("Closing Database...") - cli.DiscV5API.DiscV5.LocalNode().Database().Close() - log.Info("Closing UDPv5 protocol...") - cli.DiscV5API.DiscV5.Close() if cli.HistoryNetwork != nil { log.Info("Closing history network...") cli.HistoryNetwork.Stop() @@ -155,9 +151,12 @@ func (cli *Client) closePortalRpcServer() { log.Info("Closing state network...") cli.StateNetwork.Stop() } + log.Info("Closing Database...") + cli.DiscV5API.DiscV5.LocalNode().Database().Close() + log.Info("Closing UDPv5 protocol...") + cli.DiscV5API.DiscV5.Close() log.Info("Closing servers...") cli.Server.Close() - os.Exit(1) }