forked from LBRYCommunity/lbry-sdk
don't probe peers too far from the top closest
This commit is contained in:
parent
5c60c09fef
commit
068f46d137
1 changed files with 3 additions and 1 deletions
|
@ -86,7 +86,7 @@ class IterativeFinder:
|
|||
|
||||
self.key = key
|
||||
self.bottom_out_limit = bottom_out_limit
|
||||
self.max_results = max_results
|
||||
self.max_results = max(constants.K, max_results)
|
||||
self.exclude = exclude or []
|
||||
|
||||
self.active: typing.Dict['KademliaPeer', int] = {} # peer: distance, sorted
|
||||
|
@ -229,6 +229,8 @@ class IterativeFinder:
|
|||
continue
|
||||
if added >= constants.ALPHA:
|
||||
break
|
||||
if index > self.max_results:
|
||||
break
|
||||
origin_address = (peer.address, peer.udp_port)
|
||||
if origin_address in self.exclude:
|
||||
continue
|
||||
|
|
Loading…
Reference in a new issue