shuffle hashes requested, so requesting peers don't all request the same hashes at the same time

This commit is contained in:
kennycud
2025-07-23 16:29:47 -07:00
parent 41a747e34f
commit 769cc8b26e

View File

@@ -772,6 +772,8 @@ public class ArbitraryDataFileListManager {
String ourAddress = Network.getInstance().getOurExternalIpAddressAndPort();
ArbitraryDataFileListMessage arbitraryDataFileListMessage;
Collections.shuffle(hashes);
// Remove optional parameters if the requesting peer doesn't support it yet
// A message with less statistical data is better than no message at all
if (!peer.isAtLeastVersion(MIN_PEER_VERSION_FOR_FILE_LIST_STATS)) {