Skip to content

Commit

Permalink
allow running some extra probes for k replacements
Browse files Browse the repository at this point in the history
  • Loading branch information
shyba committed Feb 12, 2022
1 parent 15f2dbf commit 4c7e345
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lbry/dht/protocol/iterative_find.py
Expand Up @@ -184,11 +184,12 @@ def _search_round(self):
for index, peer in enumerate(self.active.keys()):
if index == 0:
log.debug("closest to probe: %s", peer.node_id.hex()[:8])

if peer in self.contacted:
continue
if len(self.running_probes) >= constants.ALPHA:
break
if index > (constants.K - 1):
if index > (constants.K + len(self.running_probes)):
break
origin_address = (peer.address, peer.udp_port)
if origin_address in self.exclude:
Expand Down

0 comments on commit 4c7e345

Please sign in to comment.