Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -2139,7 +2140,9 @@ func (s *server) Start() error {
peerAddr, true,
s.cfg.ConnectionTimeout,
)
if err != nil {
if err != nil &&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems this would only happen if AddPeers had a duplicate? Or I guess if two DNS hosts return the same IP?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might be that the connection manager started just above accepted a connection from the configured peer before the attempt to add the peer from the config here. Unfortunately I can't get to the logs from before applying this fix any more to prove that this is what happened but I'll add an itest for this to make sure I'm going in the right direction. Thanks!

!lnutils.ErrorAs[*errPeerAlreadyConnected](err) {

startErr = fmt.Errorf("unable to connect to "+
"peer address provided as a config "+
"option: %v", err)
Expand Down