|
|
@ -486,9 +486,16 @@ func (n *Node) OnStop() { |
|
|
|
n.BaseService.OnStop() |
|
|
|
|
|
|
|
n.Logger.Info("Stopping Node") |
|
|
|
|
|
|
|
// first stop the non-reactor services
|
|
|
|
n.eventBus.Stop() |
|
|
|
n.indexerService.Stop() |
|
|
|
|
|
|
|
// now stop the reactors
|
|
|
|
// TODO: gracefully disconnect from peers.
|
|
|
|
n.sw.Stop() |
|
|
|
|
|
|
|
// finally stop the listeners / external services
|
|
|
|
for _, l := range n.rpcListeners { |
|
|
|
n.Logger.Info("Closing rpc listener", "listener", l) |
|
|
|
if err := l.Close(); err != nil { |
|
|
@ -496,9 +503,6 @@ func (n *Node) OnStop() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
n.eventBus.Stop() |
|
|
|
n.indexerService.Stop() |
|
|
|
|
|
|
|
if pvsc, ok := n.privValidator.(*privval.SocketPV); ok { |
|
|
|
if err := pvsc.Stop(); err != nil { |
|
|
|
n.Logger.Error("Error stopping priv validator socket client", "err", err) |
|
|
|