Skip to content

Commit

Permalink
Reorder of Close() calls in closePortalRpcServer
Browse files Browse the repository at this point in the history
  • Loading branch information
r4f4ss committed Sep 18, 2024
1 parent 68dbb1a commit 2755aee
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions cmd/shisui/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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)
}

Expand Down

0 comments on commit 2755aee

Please sign in to comment.