summaryrefslogtreecommitdiff
path: root/src/or/routerparse.c
diff options
context:
space:
mode:
authorteor <teor2345@gmail.com>2014-12-20 21:53:00 +1100
committerteor <teor2345@gmail.com>2014-12-24 06:13:32 +1100
commit1ee41b3eef4b5e561c7c73e79885fe858dac6d80 (patch)
tree0a751121774b65ef5a82b0a526eea51534000a52 /src/or/routerparse.c
parent083c58f126a4390b96b0e3f14d809502d8702f3d (diff)
downloadtor-1ee41b3eef4b5e561c7c73e79885fe858dac6d80.tar.gz
tor-1ee41b3eef4b5e561c7c73e79885fe858dac6d80.zip
Allow consensus interval of 10 seconds when testing
Decrease minimum consensus interval to 10 seconds when TestingTorNetwork is set. (Or 5 seconds for the first consensus.) Fix code that assumes larger interval values. This assists in quickly bootstrapping a testing Tor network. Fixes bugs 13718 & 13823.
Diffstat (limited to 'src/or/routerparse.c')
-rw-r--r--src/or/routerparse.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index bc3b00226a..8176d47262 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -2598,11 +2598,15 @@ networkstatus_parse_vote_from_string(const char *s, const char **eos_out,
(int) tor_parse_long(tok->args[1], 10, 0, INT_MAX, &ok, NULL);
if (!ok)
goto err;
- if (ns->valid_after + MIN_VOTE_INTERVAL > ns->fresh_until) {
+ if (ns->valid_after +
+ (get_options()->TestingTorNetwork ?
+ MIN_VOTE_INTERVAL_TESTING : MIN_VOTE_INTERVAL) > ns->fresh_until) {
log_warn(LD_DIR, "Vote/consensus freshness interval is too short");
goto err;
}
- if (ns->valid_after + MIN_VOTE_INTERVAL*2 > ns->valid_until) {
+ if (ns->valid_after +
+ (get_options()->TestingTorNetwork ?
+ MIN_VOTE_INTERVAL_TESTING : MIN_VOTE_INTERVAL)*2 > ns->valid_until) {
log_warn(LD_DIR, "Vote/consensus liveness interval is too short");
goto err;
}