fix: replace limit by peerLimit
This commit is contained in:
parent
4f3df474cd
commit
f6d1530877
|
@ -558,7 +558,7 @@ proc requestLocally*(rdv: RendezVous, ns: string): seq[PeerRecord] =
|
|||
@[]
|
||||
|
||||
proc request*(
|
||||
rdv: RendezVous, ns: string, limit: uint64 = DiscoverLimit, peers: seq[PeerId]
|
||||
rdv: RendezVous, ns: string, peerLimit: uint64 = DiscoverLimit, peers: seq[PeerId]
|
||||
): Future[seq[PeerRecord]] {.async.} =
|
||||
## This async procedure discovers and returns peers for a given namespace
|
||||
## by sending requests and processing responses. It limits the number of
|
||||
|
@ -566,6 +566,7 @@ proc request*(
|
|||
##
|
||||
var
|
||||
s: Table[PeerId, (PeerRecord, Register)]
|
||||
limit = peerLimit
|
||||
d = Discover(ns: ns)
|
||||
|
||||
if limit > DiscoverLimit:
|
||||
|
|
|
@ -130,8 +130,6 @@ suite "RendezVous":
|
|||
switch = createSwitch(rdv)
|
||||
expect RendezVousError:
|
||||
discard await rdv.request("A".repeat(300))
|
||||
expect RendezVousError:
|
||||
discard await rdv.request("A", -1)
|
||||
expect RendezVousError:
|
||||
discard await rdv.request("A", 3000)
|
||||
expect RendezVousError:
|
||||
|
|
Loading…
Reference in New Issue