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 dd3c13582e
commit 41bc582823
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

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