summaryrefslogtreecommitdiff
path: root/src/feature/relay/router.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2021-06-14 13:10:18 -0400
committerNick Mathewson <nickm@torproject.org>2021-06-14 13:10:18 -0400
commitd642da020e750f6cff65755dcd66fed6eed2b443 (patch)
tree05a55a331278a13abf782fcf98db316ee2e72467 /src/feature/relay/router.c
parent982829650c59d6807e8c720028c9d766d69cb57c (diff)
parent265cca935aefd1a3bdbe6abc964858e10fb4a029 (diff)
downloadtor-d642da020e750f6cff65755dcd66fed6eed2b443.tar.gz
tor-d642da020e750f6cff65755dcd66fed6eed2b443.zip
Merge remote-tracking branch 'tor-gitlab/mr/338'
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 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");