avoid using tr_rand() in peerPulse(); it's giving both me and SWE some odd behavior

This commit is contained in:
Charles Kerr 2007-07-25 20:55:39 +00:00
parent abbcc72154
commit daf26881b7
1 changed files with 1 additions and 1 deletions

View File

@ -685,7 +685,7 @@ writeEnd:
all peers for 2, and so on. Randomize our starting point all peers for 2, and so on. Randomize our starting point
into "pool" to reduce such overlap */ into "pool" to reduce such overlap */
int piecesLeft = poolSize; int piecesLeft = poolSize;
int p = tr_rand( poolSize ); int p = (int)(tr_date() % poolSize);
for( ; openSlots>0 && piecesLeft>0; --piecesLeft, p=(p+1)%poolSize ) for( ; openSlots>0 && piecesLeft>0; --piecesLeft, p=(p+1)%poolSize )
{ {
const int piece = pool[p]; const int piece = pool[p];