Skip to content

Commit

Permalink
fix remaining size
Browse files Browse the repository at this point in the history
  • Loading branch information
Hitenjain14 committed Jan 16, 2024
1 parent ea4d4d9 commit 99c6987
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions zboxcore/sdk/downloadworker.go
Original file line number Diff line number Diff line change
Expand Up @@ -415,12 +415,12 @@ func (req *DownloadRequest) processDownload(ctx context.Context) {
startBlock, endBlock, numBlocks := req.startBlock, req.endBlock, req.numBlocks
// remainingSize should be calculated based on startBlock number
// otherwise end data will have null bytes.
remainingSize := size - startBlock*int64(req.effectiveBlockSize)
remainingSize := size - startBlock*int64(req.effectiveBlockSize)*int64(req.datashards)

if req.statusCallback != nil {
// Started will also initialize progress bar. So without calling this function
// other callback's call will panic
req.statusCallback.Started(req.allocationID, remotePathCB, op, int(size))
req.statusCallback.Started(req.allocationID, remotePathCB, op, int(remainingSize))
}

if req.shouldVerify {
Expand Down

0 comments on commit 99c6987

Please sign in to comment.