From d047c1175d545a470cd9a2347220fd5112d96d3c Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Tue, 6 May 2008 19:39:16 +0000 Subject: [PATCH] #917: small speedup to r5759 suggested by BentMyWookie --- libtransmission/peer-mgr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libtransmission/peer-mgr.c b/libtransmission/peer-mgr.c index 6070b4dfb..94c4e497f 100644 --- a/libtransmission/peer-mgr.c +++ b/libtransmission/peer-mgr.c @@ -1734,6 +1734,8 @@ shouldPeerBeClosed( const Torrent * t, const tr_peer * peer, int peerCount ) int peerHasEverything; if( atom->flags & ADDED_F_SEED_FLAG ) peerHasEverything = TRUE; + else if( peer->progress < tr_cpPercentDone( tor->completion ) ) + peerHasEverything = FALSE; else { tr_bitfield * tmp = tr_bitfieldDup( tr_cpPieceBitfield( tor->completion ) ); tr_bitfieldDifference( tmp, peer->have ); -- 2.40.0