lndc+lnd: fix panic when connecting to multiple peers, plus duplicate conn detection
This commit is contained in:
4 files changed
+50
-18
No files matched your search
@@ -283,13 +283,13 @@ func (s *server) handleConnectPeer(msg *connectPeerMsg) {
|
||||
// Ensure we're not already connected to this
|
||||
// peer.
|
||||
for _, peer := range s.peers {
|
||||
if peer.lightningAddr.String() ==
|
||||
addr.String() {
|
||||
if peer.lightningAddr.String() == addr.String() {
|
||||
msg.err <- fmt.Errorf(
|
||||
"already connected to peer: %v",
|
||||
peer.lightningAddr,
|
||||
)
|
||||
msg.resp <- -1
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user