mirror of
https://github.com/transmission/transmission
synced 2025-03-03 10:15:45 +00:00
when a peer sends us a block and we count it in tr_cpBlockAdd(), don't invalidate cp.sizeWhenDone unless sizeWhenDone wasn't already including that new block.
This commit is contained in:
parent
df5b6365bd
commit
89b3c5fc0a
1 changed files with 3 additions and 1 deletions
|
@ -102,11 +102,13 @@ tr_cpBlockAdd (tr_completion * cp, tr_block_index_t block)
|
|||
|
||||
if (!tr_cpBlockIsComplete (cp, block))
|
||||
{
|
||||
const tr_piece_index_t piece = tr_torBlockPiece (cp->tor, block);
|
||||
|
||||
tr_bitfieldAdd (&cp->blockBitfield, block);
|
||||
cp->sizeNow += tr_torBlockCountBytes (tor, block);
|
||||
|
||||
cp->haveValidIsDirty = true;
|
||||
cp->sizeWhenDoneIsDirty = true;
|
||||
cp->sizeWhenDoneIsDirty |= tor->info.pieces[piece].dnd;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue