summaryrefslogtreecommitdiff
path: root/src/feature/relay
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2021-05-11 15:54:14 -0400
committerNick Mathewson <nickm@torproject.org>2021-05-11 15:54:14 -0400
commit265cca935aefd1a3bdbe6abc964858e10fb4a029 (patch)
tree00f00504d77f2498b485c7ec2688872e0b1e7003 /src/feature/relay
parent9d7fca2306dc09097a24e225de59fb1ade7c9e34 (diff)
downloadtor-265cca935aefd1a3bdbe6abc964858e10fb4a029.tar.gz
tor-265cca935aefd1a3bdbe6abc964858e10fb4a029.zip
Ignore MAX_BANDWIDTH_CHANGE_FREQ on testing networks.
Part of the ever-growing 40337 fix.
Diffstat (limited to 'src/feature/relay')
-rw-r--r--src/feature/relay/router.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/feature/relay/router.c b/src/feature/relay/router.c
index 2696b8633b..c95f36aa8b 100644
--- a/src/feature/relay/router.c
+++ b/src/feature/relay/router.c
@@ -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");