From 44fcc7e44bbeb363dba17ceb0ed9df6ae6d2163b Mon Sep 17 00:00:00 2001 From: Jake Moshenko Date: Tue, 5 Jan 2016 12:13:26 -0500 Subject: [PATCH] Fix logic when deciding whether to hash for torrent --- endpoints/v2/blob.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/endpoints/v2/blob.py b/endpoints/v2/blob.py index f118566a3..adc59269c 100644 --- a/endpoints/v2/blob.py +++ b/endpoints/v2/blob.py @@ -224,7 +224,7 @@ def _upload_chunk(namespace, repo_name, upload_uuid): piece_hasher = None # TODO remove this when all in-progress blob uploads reliably contain piece hashes - if start_offset == 0 and found.piece_sha_state is not None: + if start_offset == 0 or found.piece_sha_state is not None: piece_hasher = PieceHasher(app.config['TORRENT_PIECE_SIZE'], start_offset, found.piece_hashes, found.piece_sha_state) input_fp = wrap_with_handler(input_fp, piece_hasher.update)