diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/or/circuitstats.c | 11 | ||||
-rw-r--r-- | src/or/circuitstats.h | 3 | ||||
-rw-r--r-- | src/or/config.c | 2 |
3 files changed, 14 insertions, 2 deletions
diff --git a/src/or/circuitstats.c b/src/or/circuitstats.c index 48cb89dc37..6e73372550 100644 --- a/src/or/circuitstats.c +++ b/src/or/circuitstats.c @@ -107,10 +107,19 @@ get_circuit_build_timeout_ms(void) int circuit_build_times_disabled(const or_options_t *options) { + return circuit_build_times_disabled_(options, 0); +} + +/** As circuit_build_times_disabled, but take options as an argument. */ +int +circuit_build_times_disabled_(const or_options_t *options, + int ignore_consensus) +{ if (unit_tests) { return 0; } else { - int consensus_disabled = networkstatus_get_param(NULL, "cbtdisabled", + int consensus_disabled = + ignore_consensus ? 0 : networkstatus_get_param(NULL, "cbtdisabled", 0, 0, 1); int config_disabled = !options->LearnCircuitBuildTimeout; int dirauth_disabled = options->AuthoritativeDir; diff --git a/src/or/circuitstats.h b/src/or/circuitstats.h index 23910276ae..c748f82d5e 100644 --- a/src/or/circuitstats.h +++ b/src/or/circuitstats.h @@ -18,6 +18,9 @@ double get_circuit_build_close_time_ms(void); double get_circuit_build_timeout_ms(void); int circuit_build_times_disabled(const or_options_t *options); +int circuit_build_times_disabled_(const or_options_t *options, + int ignore_consensus); + int circuit_build_times_enough_to_compute(const circuit_build_times_t *cbt); void circuit_build_times_update_state(const circuit_build_times_t *cbt, or_state_t *state); diff --git a/src/or/config.c b/src/or/config.c index a527571cb0..9edc6b799b 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -3535,7 +3535,7 @@ options_validate(or_options_t *old_options, or_options_t *options, int severity = LOG_NOTICE; /* Be a little quieter if we've deliberately disabled * LearnCircuitBuildTimeout. */ - if (circuit_build_times_disabled(options)) { + if (circuit_build_times_disabled_(options, 1)) { severity = LOG_INFO; } log_fn(severity, LD_CONFIG, "You disabled LearnCircuitBuildTimeout, but " |