make initialization failure stop from starting.
## Motivation
Initialization can have errors, for example ntp check drift being too big. currently we're ignoring these errors and starting anyway,
## Changes
check for an error in initialization and stop if found.
## Test Plan
not needed
@@ -89,7 +89,11 @@ var Cmd = &cobra.Command{
app := NewSpacemeshApp()
defer app.Cleanup(cmd, args)
- app.Initialize(cmd, args)
+ err := app.Initialize(cmd, args)
+ if err != nil {
+ log.With().Error("Failed to initialize node.", log.Err(err))
+ return
+ }
app.Start(cmd, args)
},
}
