avoid using tr_rand() in peerPulse(); it's giving both me and SWE some odd behavior
This commit is contained in:
parent
abbcc72154
commit
daf26881b7
|
@ -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];
|
||||||
|
|
Loading…
Reference in New Issue