diff --git a/tests/v2/test_peer_manager.nim b/tests/v2/test_peer_manager.nim index f6f26f5af3..eeb9e85206 100644 --- a/tests/v2/test_peer_manager.nim +++ b/tests/v2/test_peer_manager.nim @@ -607,7 +607,7 @@ procSuite "Peer Manager": .withMaxConnections(5) .build(), maxFailedAttempts = 1, - maxRelayPeers = 5, + maxRelayPeers = some(5), storage = nil) # Create 15 peers and add them to the peerstore @@ -660,7 +660,7 @@ procSuite "Peer Manager": initialBackoffInSec = 1, # with InitialBackoffInSec = 1 backoffs are: 1, 2, 4, 8secs. backoffFactor = 2, maxFailedAttempts = 10, - maxRelayPeers = 5, + maxRelayPeers = some(5), storage = nil) var p1: PeerId require p1.init("QmeuZJbXrszW2jdT7GdduSjQskPU3S7vvGWKtKgDfkDvW" & "1") @@ -709,7 +709,7 @@ procSuite "Peer Manager": .withPeerStore(10) .withMaxConnections(5) .build(), - maxRelayPeers = 5, + maxRelayPeers = some(5), maxFailedAttempts = 150, storage = nil) @@ -721,7 +721,7 @@ procSuite "Peer Manager": .withMaxConnections(5) .build(), maxFailedAttempts = 10, - maxRelayPeers = 5, + maxRelayPeers = some(5), storage = nil) let pm = PeerManager.new( @@ -730,7 +730,7 @@ procSuite "Peer Manager": .withMaxConnections(5) .build(), maxFailedAttempts = 5, - maxRelayPeers = 5, + maxRelayPeers = some(5), storage = nil) asyncTest "colocationLimit is enforced by pruneConnsByIp()": diff --git a/waku/v2/node/peer_manager/peer_manager.nim b/waku/v2/node/peer_manager/peer_manager.nim index dbfcdd5e7a..c2e430c128 100644 --- a/waku/v2/node/peer_manager/peer_manager.nim +++ b/waku/v2/node/peer_manager/peer_manager.nim @@ -344,7 +344,7 @@ proc onPeerEvent(pm: PeerManager, peerId: PeerId, event: PeerEvent) {.async.} = proc new*(T: type PeerManager, switch: Switch, - maxRelayPeers: Option[int], + maxRelayPeers: Option[int] = none(int), storage: PeerStorage = nil, initialBackoffInSec = InitialBackoffInSec, backoffFactor = BackoffFactor,