aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-04-18 22:43:52 -0400
committerNick Mathewson <nickm@torproject.org>2013-04-18 22:43:52 -0400
commitb933360ee848873db6c051eabe5aecd01b3f67a3 (patch)
treec8b3db403308586334353ad4525e774169cfe3de
parente35ca135282c6b833f51543988580bd860b49be6 (diff)
downloadtor-b933360ee848873db6c051eabe5aecd01b3f67a3.tar.gz
tor-b933360ee848873db6c051eabe5aecd01b3f67a3.zip
Add a boolean to flag-thresholds for "we have enough measured bandwidth"
Implements #8711.
-rw-r--r--changes/bug87116
-rw-r--r--src/or/dirserv.c9
2 files changed, 13 insertions, 2 deletions
diff --git a/changes/bug8711 b/changes/bug8711
new file mode 100644
index 0000000000..28a1daa454
--- /dev/null
+++ b/changes/bug8711
@@ -0,0 +1,6 @@
+ o Minor features (authority):
+ - Add a "ignoring-advertised-bws" boolean to our flag-thresholds
+ lines to describe whether we have enough measured bandwidths to
+ ignore advertised bandwidth claims. Closes ticket 8711.
+
+
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index 3755720500..66a2c14f84 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -2273,12 +2273,16 @@ char *
dirserv_get_flag_thresholds_line(void)
{
char *result=NULL;
+ const int measured_threshold =
+ get_options()->MinMeasuredBWsForAuthToIgnoreAdvertised;
+ const int enough_measured_bw = routers_with_measured_bw > measured_threshold;
+
tor_asprintf(&result,
"stable-uptime=%lu stable-mtbf=%lu "
"fast-speed=%lu "
"guard-wfu=%.03f%% guard-tk=%lu "
"guard-bw-inc-exits=%lu guard-bw-exc-exits=%lu "
- "enough-mtbf=%d",
+ "enough-mtbf=%d ignoring-advertised-bws=%d",
(unsigned long)stable_uptime,
(unsigned long)stable_mtbf,
(unsigned long)fast_bandwidth_kb*1000,
@@ -2286,7 +2290,8 @@ dirserv_get_flag_thresholds_line(void)
(unsigned long)guard_tk,
(unsigned long)guard_bandwidth_including_exits_kb*1000,
(unsigned long)guard_bandwidth_excluding_exits_kb*1000,
- enough_mtbf_info ? 1 : 0);
+ enough_mtbf_info ? 1 : 0,
+ enough_measured_bw ? 1 : 0);
return result;
}