[misc] shut down blockchain at last

pull/3649/head
Jacky Wang 4 years ago committed by Leo Chen
parent ba32888f62
commit 1770f1a30b
  1. 6
      node/node.go

@ -1173,9 +1173,6 @@ func (node *Node) ServiceManager() *service.Manager {
// ShutDown gracefully shut down the node server and dump the in-memory blockchain state into DB.
func (node *Node) ShutDown() {
node.Blockchain().Stop()
node.Beaconchain().Stop()
if err := node.StopRPC(); err != nil {
utils.Logger().Error().Err(err).Msg("failed to stop RPC")
}
@ -1199,6 +1196,9 @@ func (node *Node) ShutDown() {
utils.Logger().Error().Err(err).Msg("failed to stop p2p host")
}
node.Blockchain().Stop()
node.Beaconchain().Stop()
const msg = "Successfully shut down!\n"
utils.Logger().Print(msg)
fmt.Print(msg)

Loading…
Cancel
Save