aboutsummaryrefslogtreecommitdiff
path: root/src/feature/relay/router.c
diff options
context:
space:
mode:
authorAlexander Færøy <ahf@torproject.org>2021-10-21 12:35:26 +0000
committerAlexander Færøy <ahf@torproject.org>2021-10-21 12:35:26 +0000
commit0135fb028c8ca0ce310009f20efef89e53a36f2c (patch)
tree6aadf5f93ffc32d125125217420e3151512ba976 /src/feature/relay/router.c
parent5717b88bcb88d374b7b934622f0b7bf62cdab05c (diff)
parent265cca935aefd1a3bdbe6abc964858e10fb4a029 (diff)
downloadtor-0135fb028c8ca0ce310009f20efef89e53a36f2c.tar.gz
tor-0135fb028c8ca0ce310009f20efef89e53a36f2c.zip
Merge remote-tracking branch 'tor-gitlab/mr/338' into maint-0.4.5
Diffstat (limited to 'src/feature/relay/router.c')
-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 0589786619..7f156d1150 100644
--- a/src/feature/relay/router.c
+++ b/src/feature/relay/router.c
@@ -2622,7 +2622,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");