Changeset 13673


Ignore:
Timestamp:
Dec 15, 2012, 3:47:11 AM (8 years ago)
Author:
jordan
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/completion.c

    r13625 r13673  
    103103    if (!tr_cpBlockIsComplete (cp, block))
    104104    {
     105        const tr_piece_index_t piece = tr_torBlockPiece (cp->tor, block);
     106
    105107        tr_bitfieldAdd (&cp->blockBitfield, block);
    106108        cp->sizeNow += tr_torBlockCountBytes (tor, block);
    107109
    108110        cp->haveValidIsDirty = true;
    109         cp->sizeWhenDoneIsDirty = true;
     111        cp->sizeWhenDoneIsDirty |= tor->info.pieces[piece].dnd;
    110112    }
    111113}
Note: See TracChangeset for help on using the changeset viewer.