]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Ignore MAX_BANDWIDTH_CHANGE_FREQ on testing networks.
authorNick Mathewson <nickm@torproject.org>
Tue, 11 May 2021 19:54:14 +0000 (15:54 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 11 May 2021 19:54:14 +0000 (15:54 -0400)
Part of the ever-growing 40337 fix.

changes/ticket40337
src/feature/relay/router.c

index 02ea29ffc11830cd253f3bcc5dacda7b8ec6e57f..1c86fc4c99536870a268014bc83e29eba0256cef 100644 (file)
@@ -11,3 +11,6 @@
       immediately from startup.  Previously, they waited
       until they had been running for a full day.   Closes ticket
       40337.
+    - Relays on testing networks no longer rate-limit how frequently
+      they are willing to report new bandwidth measurements. Part of a fix
+      for ticket 40337.
index 2696b8633bc1aa6b07853e85f7ad3313e6b79d86..c95f36aa8b67d73eef3432f93db5dd735f607160 100644 (file)
@@ -2599,7 +2599,10 @@ check_descriptor_bandwidth_changed(time_t now)
   if ((prev != cur && (!prev || !cur)) ||
       cur > (prev * BANDWIDTH_CHANGE_FACTOR) ||
       cur < (prev / BANDWIDTH_CHANGE_FACTOR) ) {
-    if (last_changed+MAX_BANDWIDTH_CHANGE_FREQ < now || !prev) {
+    const bool change_recent_enough =
+      last_changed+MAX_BANDWIDTH_CHANGE_FREQ < now;
+    const bool testing_network = get_options()->TestingTorNetwork;
+    if (change_recent_enough || testing_network || !prev) {
       log_info(LD_GENERAL,
                "Measured bandwidth has changed; rebuilding descriptor.");
       mark_my_descriptor_dirty("bandwidth has changed");