From 3f8c8e01c697b2f666908daca3d4eaf21a1dde30 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Mon, 7 Feb 2022 21:47:10 -0300 Subject: [PATCH] only return good (contacted) peers --- lbry/dht/protocol/iterative_find.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lbry/dht/protocol/iterative_find.py b/lbry/dht/protocol/iterative_find.py index c2fc10429..ad0f03863 100644 --- a/lbry/dht/protocol/iterative_find.py +++ b/lbry/dht/protocol/iterative_find.py @@ -317,7 +317,7 @@ class IterativeNodeFinder(IterativeFinder): peer for peer in from_iter if peer not in self.yielded_peers and peer.node_id != self.protocol.node_id - and self.peer_manager.peer_is_good(peer) is not False + and self.peer_manager.peer_is_good(peer) is True # return only peers who answered ] not_yet_yielded.sort(key=lambda peer: self.distance(peer.node_id)) to_yield = not_yet_yielded[:max(constants.K, self.max_results)]