From 1d5bbe203c4255b72b71ce92a471686284e0a635 Mon Sep 17 00:00:00 2001 From: Gabriel mermelstein Date: Tue, 18 Jun 2024 19:18:03 +0200 Subject: [PATCH] stop connecting to out peers until target is reached --- waku/node/peer_manager/peer_manager.nim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/waku/node/peer_manager/peer_manager.nim b/waku/node/peer_manager/peer_manager.nim index a2993c5241..e49d25361e 100644 --- a/waku/node/peer_manager/peer_manager.nim +++ b/waku/node/peer_manager/peer_manager.nim @@ -725,7 +725,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: