mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Balance peer selection in getFetchPack
This commit is contained in:
@@ -576,9 +576,7 @@ public:
|
||||
{
|
||||
if (peer->hasRange (nextLedger->getLedgerSeq() - 1, nextLedger->getLedgerSeq()))
|
||||
{
|
||||
if (count++ == 0)
|
||||
target = peer;
|
||||
else if ((rand () % ++count) == 0)
|
||||
if ((count++ == 0) || ((rand() % count) == 0))
|
||||
target = peer;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user