mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-03 11:39:52 +02:00
server: remove pending conn request if we recv a outbound conn after a scheduled callback
In this commit, we ensure that if we're already ignoring a connection, then we also ignore the pending persistent connection request. Otherwise, we'll move to accept the replaced connection, but then continue to attempt connection requests.
This commit is contained in:
parent
dcf841c33b
commit
c975753f1e
@ -1727,6 +1727,11 @@ func (s *server) OutboundPeerConnected(connReq *connmgr.ConnReq, conn net.Conn)
|
|||||||
// ignore this connection.
|
// ignore this connection.
|
||||||
if _, ok := s.scheduledPeerConnection[pubStr]; ok {
|
if _, ok := s.scheduledPeerConnection[pubStr]; ok {
|
||||||
srvrLog.Debugf("Ignoring connection, peer already scheduled")
|
srvrLog.Debugf("Ignoring connection, peer already scheduled")
|
||||||
|
|
||||||
|
if connReq != nil {
|
||||||
|
s.connMgr.Remove(connReq.ID())
|
||||||
|
}
|
||||||
|
|
||||||
conn.Close()
|
conn.Close()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user