mirror of
https://github.com/transmission/transmission.git
synced 2026-05-08 09:39:08 +01:00
#980 optimistic unchoking is broken
This commit is contained in:
@@ -1532,7 +1532,7 @@ getWeightedRate( const tr_peer * peer, int clientIsSeed )
|
||||
static void
|
||||
rechoke( Torrent * t )
|
||||
{
|
||||
int i, n, peerCount, size, unchokedInterested;
|
||||
int i, peerCount, size, unchokedInterested;
|
||||
tr_peer ** peers = getConnectedPeers( t, &peerCount );
|
||||
struct ChokeData * choke = tr_new0( struct ChokeData, peerCount );
|
||||
const int clientIsSeed = tr_torrentIsSeed( t->tor );
|
||||
@@ -1574,9 +1574,6 @@ rechoke( Torrent * t )
|
||||
if( choke[i].isInterested )
|
||||
++unchokedInterested;
|
||||
}
|
||||
n = i;
|
||||
while( i<size )
|
||||
choke[i++].doUnchoke = 0;
|
||||
|
||||
/* optimistic unchoke */
|
||||
if( i < size )
|
||||
@@ -1593,7 +1590,7 @@ rechoke( Torrent * t )
|
||||
tr_ptrArrayAppend( randPool, choke );
|
||||
}
|
||||
i = tr_rand( tr_ptrArraySize( randPool ) );
|
||||
c = ( struct ChokeData* )tr_ptrArrayNth( randPool, i);
|
||||
c = tr_ptrArrayNth( randPool, i);
|
||||
c->doUnchoke = 1;
|
||||
t->optimistic = c->peer;
|
||||
tr_ptrArrayFree( randPool, NULL );
|
||||
|
||||
Reference in New Issue
Block a user