From 7133043ff7ce6a5fbd76c1c85cc5534ce9298320 Mon Sep 17 00:00:00 2001 From: Alex Akselrod Date: Tue, 25 Jun 2024 13:24:59 -0700 Subject: [PATCH] server: don't die on startup when persistent peer already connected --- server.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server.go b/server.go index 6ab197f86a1..4a41da0b636 100644 --- a/server.go +++ b/server.go @@ -52,6 +52,7 @@ import ( "github.com/lightningnetwork/lnd/lnpeer" "github.com/lightningnetwork/lnd/lnrpc" "github.com/lightningnetwork/lnd/lnrpc/routerrpc" + "github.com/lightningnetwork/lnd/lnutils" "github.com/lightningnetwork/lnd/lnwallet" "github.com/lightningnetwork/lnd/lnwallet/chainfee" "github.com/lightningnetwork/lnd/lnwallet/chanfunding" @@ -2139,7 +2140,9 @@ func (s *server) Start() error { peerAddr, true, s.cfg.ConnectionTimeout, ) - if err != nil { + if err != nil && + !lnutils.ErrorAs[*errPeerAlreadyConnected](err) { + startErr = fmt.Errorf("unable to connect to "+ "peer address provided as a config "+ "option: %v", err)