From acd0e7790121b741d3a94935848e5f278cacfdac Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sat, 26 Jun 2010 18:49:31 +0000 Subject: [PATCH] (trunk libT) #3329 "connection problems when downloading" -- when deciding which peer to connect to, take download/seed status into account --- libtransmission/peer-mgr.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libtransmission/peer-mgr.c b/libtransmission/peer-mgr.c index a36bb9b14..ea714b85c 100644 --- a/libtransmission/peer-mgr.c +++ b/libtransmission/peer-mgr.c @@ -3393,6 +3393,10 @@ getPeerCandidateScore( const tr_torrent * tor, const struct peer_atom * atom, ui i = torrentWasRecentlyStarted( tor ) ? 0 : 1; score = addValToKey( score, 1, i ); + /* prefer torrents we're downloading with */ + i = tr_torrentIsSeed( tor ) ? 1 : 0; + score = addValToKey( score, 1, i ); + /* prefer peers that we might have a chance of uploading to... so lower seed probability is better */ if( atom->seedProbability == 100 ) i = 101;