From 6f61fbb127477bc34204a5a11480028232e58452 Mon Sep 17 00:00:00 2001 From: CalDescent Date: Fri, 21 Jan 2022 15:20:04 +0000 Subject: [PATCH] Reduced strictness of rate limiter, to allow two additional file list requests (15 and 30 seconds after initial attempt) This should help catch any remaining chunks that were unable to be fetched in the first attempt due to network failures, bad peers, etc. --- .../arbitrary/ArbitraryDataFileListManager.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/org/qortal/controller/arbitrary/ArbitraryDataFileListManager.java b/src/main/java/org/qortal/controller/arbitrary/ArbitraryDataFileListManager.java index 8b26bdc3..a1dc5d21 100644 --- a/src/main/java/org/qortal/controller/arbitrary/ArbitraryDataFileListManager.java +++ b/src/main/java/org/qortal/controller/arbitrary/ArbitraryDataFileListManager.java @@ -103,6 +103,18 @@ public class ArbitraryDataFileListManager { } long timeSinceLastAttempt = NTP.getTime() - lastAttemptTimestamp; + + // Allow a second attempt after 15 seconds, and another after 30 seconds + if (timeSinceLastAttempt > 15 * 1000L) { + // We haven't tried for at least 15 seconds + + if (networkBroadcastCount < 3) { + // We've made less than 3 total attempts + return true; + } + } + + // Then allow another 5 attempts, each 5 minutes apart if (timeSinceLastAttempt > 5 * 60 * 1000L) { // We haven't tried for at least 5 minutes @@ -112,6 +124,7 @@ public class ArbitraryDataFileListManager { } } + // From then on, only try once every 24 hours, to reduce network spam if (timeSinceLastAttempt > 24 * 60 * 60 * 1000L) { // We haven't tried for at least 24 hours return true;