abort download if atleast one block failed

This commit is contained in:
Dmitriy Ryajov 2022-01-12 11:28:46 -06:00
parent 15ef6c78eb
commit c945d2b382
No known key found for this signature in database
GPG Key ID: DA8C680CE7C657A4
1 changed files with 2 additions and 2 deletions

View File

@ -72,8 +72,8 @@ proc streamBlocks*(
# since disk IO is blocking
for c in blockManifest:
without blk =? (await node.blockStore.getBlock(c)):
trace "Couldn't retrieve block", cid = c
continue
warn "Couldn't retrieve block", cid = c
break # abort if we couldn't get a block
trace "Streaming block data", cid = blk.cid, bytes = blk.data.len
await stream.pushData(blk.data)