diff --git a/libtransmission/torrent.c b/libtransmission/torrent.c index c57cf5f1f..12871d5ed 100644 --- a/libtransmission/torrent.c +++ b/libtransmission/torrent.c @@ -741,7 +741,9 @@ tr_torrentStat( tr_torrent * tor ) s->haveUnchecked = tr_cpHaveTotal( tor->completion ) - s->haveValid; - { + if( !s->leftUntilDone ) + s->desiredAvailable = 0; + else { tr_piece_index_t i; tr_bitfield * peerPieces = tr_peerMgrGetAvailable( tor->handle->peerMgr, tor->info.hash ); diff --git a/libtransmission/utils.c b/libtransmission/utils.c index fecd2be36..559fef204 100644 --- a/libtransmission/utils.c +++ b/libtransmission/utils.c @@ -740,7 +740,7 @@ tr_bitfieldAdd( tr_bitfield * bitfield, size_t nth ) return -1; bitfield->bits[i] |= ands[nth&7u]; - assert( tr_bitfieldHas( bitfield, nth ) ); + /*assert( tr_bitfieldHas( bitfield, nth ) );*/ return 0; } @@ -771,7 +771,7 @@ tr_bitfieldRem( tr_bitfield * bitfield, return -1; bitfield->bits[i] &= rems[nth&7u]; - assert( !tr_bitfieldHas( bitfield, nth ) ); + /*assert( !tr_bitfieldHas( bitfield, nth ) );*/ return 0; }