fix: handle RPC server panic if port is in use (#418)

This commit is contained in:
noot
2023-04-25 18:30:51 +02:00
committed by GitHub
parent 177b96da76
commit 74f52af9d5
2 changed files with 6 additions and 0 deletions

View File

@@ -70,6 +70,9 @@ func RunBootnode(ctx context.Context, cfg *Config) error {
},
IsBootnodeOnly: true,
})
if err != nil {
return err
}
log.Infof("starting bootnode with data-dir %s", cfg.DataDir)
err = rpcServer.Start()

View File

@@ -157,6 +157,9 @@ func RunSwapDaemon(ctx context.Context, conf *SwapdConfig) (err error) {
RecoveryDB: sdb.RecoveryDB(),
Namespaces: rpc.AllNamespaces(),
})
if err != nil {
return err
}
log.Infof("starting swapd with data-dir %s", conf.EnvConf.DataDir)
err = rpcServer.Start()