Skip to content

Commit

Permalink
stop connecting to out peers until target is reached (#2823)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielmer authored Jun 20, 2024
1 parent dd3c135 commit 41bc582
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion waku/node/peer_manager/peer_manager.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 41bc582

Please sign in to comment.