forked from LBRYCommunity/lbry-sdk
when looking up peers, only return one instance of each peer
This commit is contained in:
parent
7e4f36e8b4
commit
0506dfba10
1 changed files with 2 additions and 1 deletions
|
@ -32,8 +32,9 @@ class DHTPeerFinder(object):
|
||||||
bin_hash = binascii.unhexlify(blob_hash)
|
bin_hash = binascii.unhexlify(blob_hash)
|
||||||
|
|
||||||
def filter_peers(peer_list):
|
def filter_peers(peer_list):
|
||||||
|
peers = set(peer_list)
|
||||||
good_peers = []
|
good_peers = []
|
||||||
for host, port in peer_list:
|
for host, port in peers:
|
||||||
peer = self.peer_manager.get_peer(host, port)
|
peer = self.peer_manager.get_peer(host, port)
|
||||||
if peer.is_available() is True:
|
if peer.is_available() is True:
|
||||||
good_peers.append(peer)
|
good_peers.append(peer)
|
||||||
|
|
Loading…
Reference in a new issue