Some cleanups.

This commit is contained in:
JoelKatz
2013-08-11 22:57:57 -07:00
parent 8b06891663
commit fbfb150cff
3 changed files with 8 additions and 5 deletions

View File

@@ -210,7 +210,7 @@ void InboundLedger::addPeers ()
return;
// We traverse the peer list in random order so as not to favor any particular peer
int firstPeer = rand () & vSize;
int firstPeer = rand () % vSize;
int found = 0;
@@ -228,7 +228,7 @@ void InboundLedger::addPeers ()
}
if (!found)
for (int i = 0; i < vSize; ++i)
for (int i = 0; i < ((vSize > 3) ? 3 : vSize); ++i)
peerHas (peerList[ (i + firstPeer) % vSize]);
}