aboutsummaryrefslogtreecommitdiff
path: root/src/or/dirvote.h
diff options
context:
space:
mode:
authorLinus Nordberg <linus@torproject.org>2013-06-05 15:48:57 +0200
committerLinus Nordberg <linus@torproject.org>2013-06-08 15:25:32 +0200
commit4d54b9774d11f47c6a670ab9b380e027a524f5f9 (patch)
tree6256b3849c531a7ff05914e6055f24b6befdbc06 /src/or/dirvote.h
parentbcdc0022693c75ea1523468e783bf03832e0a358 (diff)
downloadtor-4d54b9774d11f47c6a670ab9b380e027a524f5f9.tar
tor-4d54b9774d11f47c6a670ab9b380e027a524f5f9.tar.gz
Add support for offsetting the voting interval in order to bootstrap faster.
A new option TestingV3AuthVotingStartOffset is added which offsets the starting time of the voting interval. This is possible only when TestingTorNetwork is set. This patch makes run_scheduled_events() check for new consensus downloads every second when TestingTorNetwork, instead of every minute. This should be fine, see #8532 for reasoning. This patch also brings MIN_VOTE_SECONDS and MIN_DIST_SECONDS down from 20 to 2 seconds, unconditionally. This makes sanity checking of misconfiguration slightly less sane. Addresses #8532.
Diffstat (limited to 'src/or/dirvote.h')
-rw-r--r--src/or/dirvote.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/or/dirvote.h b/src/or/dirvote.h
index b23645212..a3e6cc0d6 100644
--- a/src/or/dirvote.h
+++ b/src/or/dirvote.h
@@ -13,9 +13,9 @@
#define TOR_DIRVOTE_H
/** Lowest allowable value for VoteSeconds. */
-#define MIN_VOTE_SECONDS 20
+#define MIN_VOTE_SECONDS 2
/** Lowest allowable value for DistSeconds. */
-#define MIN_DIST_SECONDS 20
+#define MIN_DIST_SECONDS 2
/** Smallest allowable voting interval. */
#define MIN_VOTE_INTERVAL 300
@@ -86,7 +86,9 @@ authority_cert_t *authority_cert_dup(authority_cert_t *cert);
/* vote scheduling */
void dirvote_get_preferred_voting_intervals(vote_timing_t *timing_out);
-time_t dirvote_get_start_of_next_interval(time_t now, int interval);
+time_t dirvote_get_start_of_next_interval(time_t now,
+ int interval,
+ int offset);
void dirvote_recalculate_timing(const or_options_t *options, time_t now);
void dirvote_act(const or_options_t *options, time_t now);