test incomplete streams, respect real length, delete on incomplete assembly

This commit is contained in:
Victor Shyba 2019-02-06 15:40:16 -03:00
parent 3508da4993
commit 3a15ff4bcd
4 changed files with 23 additions and 2 deletions
lbrynet/blob

View file

@ -67,7 +67,7 @@ class BlobFile:
self.finished_writing = asyncio.Event(loop=loop)
self.blob_write_lock = asyncio.Lock(loop=loop)
if os.path.isfile(os.path.join(blob_dir, blob_hash)):
length = length or int(os.stat(os.path.join(blob_dir, blob_hash)).st_size)
length = int(os.stat(os.path.join(blob_dir, blob_hash)).st_size)
self.length = length
self.verified.set()
self.finished_writing.set()