Skip to content

Commit

Permalink
don't error when node unable to connect on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
JssDWt committed Aug 1, 2024
1 parent 5b196ca commit 441e39c
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion cmd/lspd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"github.com/breez/lspd/config"
"github.com/breez/lspd/history"
"github.com/breez/lspd/interceptor"
"github.com/breez/lspd/lightning"
"github.com/breez/lspd/lnd"
"github.com/breez/lspd/lsps0"
"github.com/breez/lspd/lsps2"
Expand Down Expand Up @@ -314,7 +315,19 @@ func initializeNodes(configs []*config.NodeConfig) ([]*common.Node, error) {
// in config.
info, err := node.Client.GetInfo()
if err != nil {
return nil, fmt.Errorf("failed to get info from host %s", node.NodeConfig.Host)
decodedPubkey, decodeErr := hex.DecodeString(
node.NodeConfig.NodePubkey)
if node.NodeConfig.Name == "" || node.NodeConfig.NodePubkey == "" ||
decodeErr != nil || len(decodedPubkey) != 33 {

return nil, fmt.Errorf("failed to get info from host %s",
node.NodeConfig.Host)
}

info = &lightning.GetInfoResult{
Alias: node.NodeConfig.Name,
Pubkey: node.NodeConfig.NodePubkey,
}
}

if node.NodeConfig.Name == "" {
Expand Down

0 comments on commit 441e39c

Please sign in to comment.