Skip to content

Commit

Permalink
fix: replace limit by peerLimit
Browse files Browse the repository at this point in the history
  • Loading branch information
lchenut committed Oct 3, 2024
1 parent 4f3df47 commit f6d1530
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 2 additions & 1 deletion libp2p/protocols/rendezvous.nim
Original file line number Diff line number Diff line change
Expand Up @@ -558,14 +558,15 @@ 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
## peer records retrieved based on the provided limit.
##
var
s: Table[PeerId, (PeerRecord, Register)]
limit = peerLimit
d = Discover(ns: ns)

if limit > DiscoverLimit:
Expand Down
2 changes: 0 additions & 2 deletions tests/testrendezvous.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit f6d1530

Please sign in to comment.