mirror of https://github.com/waku-org/nwaku.git
stop connecting to out peers until target is reached (#2823)
This commit is contained in:
parent
dd3c13582e
commit
41bc582823
|
@ -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:
|
||||||
|
|
Loading…
Reference in New Issue