stop connecting to out peers until target is reached (#2823)

This commit is contained in:
gabrielmer 2024-06-20 12:16:15 +02:00 committed by GitHub
parent 7e4f18cda7
commit 57ec129a48

View File

@ -732,7 +732,8 @@ proc connectToRelayPeers*(pm: PeerManager) {.async.} =
shuffle(outsideBackoffPeers)
var index = 0
var numPendingConnReqs = outsideBackoffPeers.len
var numPendingConnReqs =
min(outsideBackoffPeers.len, pm.outRelayPeersTarget - outRelayPeers.len)
## number of outstanding connection requests
while numPendingConnReqs > 0 and outRelayPeers.len < pm.outRelayPeersTarget: