mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-23 06:35:07 +01:00
Merge pull request #5086 from halseth/mobile-graceful-exit
mobile: gracefully exit if lnd fails to start
This commit is contained in:
commit
fa4155c126
1 changed files with 6 additions and 3 deletions
|
@ -50,13 +50,15 @@ func Start(extraArgs string, unlockerReady, rpcReady Callback) {
|
|||
loadedConfig, err := lnd.LoadConfig()
|
||||
if err != nil {
|
||||
_, _ = fmt.Fprintln(os.Stderr, err)
|
||||
os.Exit(1)
|
||||
rpcReady.OnError(err)
|
||||
return
|
||||
}
|
||||
|
||||
// Hook interceptor for os signals.
|
||||
if err := signal.Intercept(); err != nil {
|
||||
_, _ = fmt.Fprintln(os.Stderr, err)
|
||||
os.Exit(1)
|
||||
rpcReady.OnError(err)
|
||||
return
|
||||
}
|
||||
|
||||
// Set up channels that will be notified when the RPC servers are ready
|
||||
|
@ -90,7 +92,8 @@ func Start(extraArgs string, unlockerReady, rpcReady Callback) {
|
|||
} else {
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
}
|
||||
os.Exit(1)
|
||||
rpcReady.OnError(err)
|
||||
return
|
||||
}
|
||||
}()
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue