server: don't die on startup when persistent peer already connected

This commit is contained in:
Alex Akselrod 2024-06-25 13:24:59 -07:00
parent ce813276d5
commit 7133043ff7
No known key found for this signature in database
GPG key ID: 57D7612D178AA487

View file

@ -52,6 +52,7 @@ import (
"github.com/lightningnetwork/lnd/lnpeer" "github.com/lightningnetwork/lnd/lnpeer"
"github.com/lightningnetwork/lnd/lnrpc" "github.com/lightningnetwork/lnd/lnrpc"
"github.com/lightningnetwork/lnd/lnrpc/routerrpc" "github.com/lightningnetwork/lnd/lnrpc/routerrpc"
"github.com/lightningnetwork/lnd/lnutils"
"github.com/lightningnetwork/lnd/lnwallet" "github.com/lightningnetwork/lnd/lnwallet"
"github.com/lightningnetwork/lnd/lnwallet/chainfee" "github.com/lightningnetwork/lnd/lnwallet/chainfee"
"github.com/lightningnetwork/lnd/lnwallet/chanfunding" "github.com/lightningnetwork/lnd/lnwallet/chanfunding"
@ -2139,7 +2140,9 @@ func (s *server) Start() error {
peerAddr, true, peerAddr, true,
s.cfg.ConnectionTimeout, s.cfg.ConnectionTimeout,
) )
if err != nil { if err != nil &&
!lnutils.ErrorAs[*errPeerAlreadyConnected](err) {
startErr = fmt.Errorf("unable to connect to "+ startErr = fmt.Errorf("unable to connect to "+
"peer address provided as a config "+ "peer address provided as a config "+
"option: %v", err) "option: %v", err)