diff options
author | Alexander Færøy <ahf@torproject.org> | 2021-10-21 12:35:36 +0000 |
---|---|---|
committer | Alexander Færøy <ahf@torproject.org> | 2021-10-21 12:35:36 +0000 |
commit | bd1c14f0156c4d166ed1706544242e31d7ddceff (patch) | |
tree | bc0eba46fb171915cdfa876eb928cce943077dfb /src/feature/relay/router.c | |
parent | 1e08efdb5891008f8180603bccf461c467275f57 (diff) | |
parent | 0135fb028c8ca0ce310009f20efef89e53a36f2c (diff) | |
download | tor-bd1c14f0156c4d166ed1706544242e31d7ddceff.tar.gz tor-bd1c14f0156c4d166ed1706544242e31d7ddceff.zip |
Merge branch 'maint-0.4.5' into maint-0.4.6
Diffstat (limited to 'src/feature/relay/router.c')
-rw-r--r-- | src/feature/relay/router.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/feature/relay/router.c b/src/feature/relay/router.c index 67d3e3ee75..a2ca472307 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"); |