From e43b29fcd151883a22a07847d652e3e94fbec096 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Wed, 1 May 2019 15:09:11 -0300 Subject: [PATCH] if the current writer is closed, its fine to open a new one --- lbrynet/blob/blob_file.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lbrynet/blob/blob_file.py b/lbrynet/blob/blob_file.py index 484e93122..b8a3e4796 100644 --- a/lbrynet/blob/blob_file.py +++ b/lbrynet/blob/blob_file.py @@ -201,7 +201,7 @@ class AbstractBlob: def get_blob_writer(self, peer_address: typing.Optional[str] = None, peer_port: typing.Optional[int] = None) -> HashBlobWriter: - if (peer_address, peer_port) in self.writers: + if (peer_address, peer_port) in self.writers and not self.writers[(peer_address, peer_port)].closed(): raise OSError(f"attempted to download blob twice from {peer_address}:{peer_port}") fut = asyncio.Future(loop=self.loop) writer = HashBlobWriter(self.blob_hash, self.get_length, fut)