From 461687ffb412af39acdfbcc776ec5b241bd0cac3 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Fri, 11 Feb 2022 16:18:14 -0300 Subject: [PATCH] check that the stored blob is at least 1 prefix byte close to peer id --- lbry/extras/daemon/components.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lbry/extras/daemon/components.py b/lbry/extras/daemon/components.py index 780b7e5d5..662a1762b 100644 --- a/lbry/extras/daemon/components.py +++ b/lbry/extras/daemon/components.py @@ -413,7 +413,8 @@ class BackgroundDownloaderComponent(Component): self.space_available = await self.space_manager.get_free_space_mb(True) if not self.is_busy and self.space_available > 10: blob_hash = next((key.hex() for key in self.dht_node.stored_blob_hashes if - key.hex() not in self.blob_manager.completed_blob_hashes), None) + key[0] == self.dht_node.protocol.node_id[0] + and key.hex() not in self.blob_manager.completed_blob_hashes), None) if blob_hash: self.ongoing_download = asyncio.create_task(self.background_downloader.download_blobs(blob_hash)) await asyncio.sleep(self.download_loop_delay_seconds)