use _value_producer in peer_list to match the downloader behavior

This commit is contained in:
Jack Robison 2019-08-16 15:52:47 -04:00
parent 1d9705fb17
commit 33945e14d3
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -3169,9 +3169,10 @@ class Daemon(metaclass=JSONRPCServerType):
else: else:
search_bottom_out_limit = 4 search_bottom_out_limit = 4
peers = [] peers = []
async for new_peers in self.dht_node.get_iterative_value_finder(unhexlify(blob_hash.encode()), max_results=1, peer_q = asyncio.Queue(loop=self.component_manager.loop)
bottom_out_limit=search_bottom_out_limit): await self.dht_node._value_producer(blob_hash, peer_q)
peers.extend(new_peers) while not peer_q.empty():
peers.extend(peer_q.get_nowait())
results = [ results = [
{ {
"node_id": hexlify(peer.node_id).decode(), "node_id": hexlify(peer.node_id).decode(),