diff options
author | teor <teor2345@gmail.com> | 2014-12-20 21:53:00 +1100 |
---|---|---|
committer | teor <teor2345@gmail.com> | 2014-12-24 06:13:32 +1100 |
commit | 1ee41b3eef4b5e561c7c73e79885fe858dac6d80 (patch) | |
tree | 0a751121774b65ef5a82b0a526eea51534000a52 /src/or/dirvote.c | |
parent | 083c58f126a4390b96b0e3f14d809502d8702f3d (diff) | |
download | tor-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/dirvote.c')
-rw-r--r-- | src/or/dirvote.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/or/dirvote.c b/src/or/dirvote.c index 39505a4f9e..c6068228f9 100644 --- a/src/or/dirvote.c +++ b/src/or/dirvote.c @@ -1107,8 +1107,12 @@ networkstatus_compute_consensus(smartlist_t *votes, vote_seconds = median_int(votesec_list, n_votes); dist_seconds = median_int(distsec_list, n_votes); - tor_assert(valid_after+MIN_VOTE_INTERVAL <= fresh_until); - tor_assert(fresh_until+MIN_VOTE_INTERVAL <= valid_until); + tor_assert(valid_after + + (get_options()->TestingTorNetwork ? + MIN_VOTE_INTERVAL_TESTING : MIN_VOTE_INTERVAL) <= fresh_until); + tor_assert(fresh_until + + (get_options()->TestingTorNetwork ? + MIN_VOTE_INTERVAL_TESTING : MIN_VOTE_INTERVAL) <= valid_until); tor_assert(vote_seconds >= MIN_VOTE_SECONDS); tor_assert(dist_seconds >= MIN_DIST_SECONDS); |