1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-03-03 18:25:35 +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:
Jordan Lee 2012-12-15 03:47:11 +00:00
parent df5b6365bd
commit 89b3c5fc0a

View file

@ -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;
}
}