Browse Source

statesync: shut down node when statesync fails (#6944)

pull/6951/head
Callum Waters 3 years ago
committed by GitHub
parent
commit
9a7ce08e3e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      node/node.go

+ 5
- 1
node/node.go View File

@ -702,7 +702,11 @@ func (n *nodeImpl) OnStart() error {
n.Logger.Info("starting state sync")
state, err := n.stateSyncReactor.Sync(context.TODO())
if err != nil {
n.Logger.Error("state sync failed", "err", err)
n.Logger.Error("state sync failed; shutting down this node", "err", err)
// stop the node
if err := n.Stop(); err != nil {
n.Logger.Error("failed to shut down node", "err", err)
}
return
}


Loading…
Cancel
Save