From f3db37ab1b7adca2c3448d03ed8270444c9d503e Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Fri, 30 May 2008 16:49:03 +0000 Subject: [PATCH] add a couple of more ways to short-circuit the tr_stat.desiredAvailable test in tr_torrentStat(), as suggested by BentMyWookie --- libtransmission/torrent.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libtransmission/torrent.c b/libtransmission/torrent.c index 12871d5ed..0ba1f131a 100644 --- a/libtransmission/torrent.c +++ b/libtransmission/torrent.c @@ -741,7 +741,7 @@ tr_torrentStat( tr_torrent * tor ) s->haveUnchecked = tr_cpHaveTotal( tor->completion ) - s->haveValid; - if( !s->leftUntilDone ) + if( !s->leftUntilDone || !tor->isRunning || !s->peersConnected ) s->desiredAvailable = 0; else { tr_piece_index_t i; -- 2.40.0