forked from LBRYCommunity/lbry-sdk
remove tried_for_this_blob so banned peers are retried for same blob
This commit is contained in:
parent
42c4fc7557
commit
a73582d9ae
1 changed files with 0 additions and 4 deletions
|
@ -88,7 +88,6 @@ class BlobDownloader:
|
||||||
if blob.get_is_verified():
|
if blob.get_is_verified():
|
||||||
return blob
|
return blob
|
||||||
self.is_running.set()
|
self.is_running.set()
|
||||||
tried_for_this_blob: typing.Set['KademliaPeer'] = set()
|
|
||||||
try:
|
try:
|
||||||
while not blob.get_is_verified() and self.is_running.is_set():
|
while not blob.get_is_verified() and self.is_running.is_set():
|
||||||
batch: typing.Set['KademliaPeer'] = set(self.connections.keys())
|
batch: typing.Set['KademliaPeer'] = set(self.connections.keys())
|
||||||
|
@ -102,8 +101,6 @@ class BlobDownloader:
|
||||||
for peer in sorted(batch, key=lambda peer: self.scores.get(peer, 0), reverse=True):
|
for peer in sorted(batch, key=lambda peer: self.scores.get(peer, 0), reverse=True):
|
||||||
if peer in self.ignored:
|
if peer in self.ignored:
|
||||||
continue
|
continue
|
||||||
if peer in tried_for_this_blob:
|
|
||||||
continue
|
|
||||||
if peer in self.active_connections:
|
if peer in self.active_connections:
|
||||||
if peer not in re_add:
|
if peer not in re_add:
|
||||||
re_add.add(peer)
|
re_add.add(peer)
|
||||||
|
@ -113,7 +110,6 @@ class BlobDownloader:
|
||||||
log.debug("request %s from %s:%i", blob_hash[:8], peer.address, peer.tcp_port)
|
log.debug("request %s from %s:%i", blob_hash[:8], peer.address, peer.tcp_port)
|
||||||
t = self.loop.create_task(self.request_blob_from_peer(blob, peer, connection_id))
|
t = self.loop.create_task(self.request_blob_from_peer(blob, peer, connection_id))
|
||||||
self.active_connections[peer] = t
|
self.active_connections[peer] = t
|
||||||
tried_for_this_blob.add(peer)
|
|
||||||
if not re_add:
|
if not re_add:
|
||||||
self.peer_queue.put_nowait(list(batch))
|
self.peer_queue.put_nowait(list(batch))
|
||||||
await self.new_peer_or_finished()
|
await self.new_peer_or_finished()
|
||||||
|
|
Loading…
Reference in a new issue