Skip to content

Commit 441e39c

Browse files
committed
don't error when node unable to connect on startup
1 parent 5b196ca commit 441e39c

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

cmd/lspd/run.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"github.com/breez/lspd/config"
2222
"github.com/breez/lspd/history"
2323
"github.com/breez/lspd/interceptor"
24+
"github.com/breez/lspd/lightning"
2425
"github.com/breez/lspd/lnd"
2526
"github.com/breez/lspd/lsps0"
2627
"github.com/breez/lspd/lsps2"
@@ -314,7 +315,19 @@ func initializeNodes(configs []*config.NodeConfig) ([]*common.Node, error) {
314315
// in config.
315316
info, err := node.Client.GetInfo()
316317
if err != nil {
317-
return nil, fmt.Errorf("failed to get info from host %s", node.NodeConfig.Host)
318+
decodedPubkey, decodeErr := hex.DecodeString(
319+
node.NodeConfig.NodePubkey)
320+
if node.NodeConfig.Name == "" || node.NodeConfig.NodePubkey == "" ||
321+
decodeErr != nil || len(decodedPubkey) != 33 {
322+
323+
return nil, fmt.Errorf("failed to get info from host %s",
324+
node.NodeConfig.Host)
325+
}
326+
327+
info = &lightning.GetInfoResult{
328+
Alias: node.NodeConfig.Name,
329+
Pubkey: node.NodeConfig.NodePubkey,
330+
}
318331
}
319332

320333
if node.NodeConfig.Name == "" {

0 commit comments

Comments
 (0)