diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-10-09 18:36:56 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-10-09 18:36:56 +0000 |
commit | 23614f952357ee4525864a5a630bfc2dc97ff514 (patch) | |
tree | 502886f861416941aa90c944bcf706287ed016c5 | |
parent | f1d4e3477b9860092f2559513d1cf5319dc2098c (diff) | |
download | tor-23614f952357ee4525864a5a630bfc2dc97ff514.tar.gz tor-23614f952357ee4525864a5a630bfc2dc97ff514.zip |
r15581@catbus: nickm | 2007-10-09 14:36:47 -0400
Recompute voting schedule whenever a consensus is set.
svn:r11808
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | src/or/dirvote.c | 3 | ||||
-rw-r--r-- | src/or/networkstatus.c | 1 |
3 files changed, 3 insertions, 2 deletions
@@ -39,6 +39,7 @@ Changes in version 0.2.0.8-alpha - 2007-??-?? - Only change the reply to a vote to "OK" if it's not already set. This gets rid of annoying "400 OK" log messages, which may have been masking some deeper issue. Bugfix on 0.2.0.7-alpha. + - When we get a valid consensus, recompute the voting schedule. o Minor bugfixes (performance): - Use a slightly simpler string hashing algorithm (copying Python's diff --git a/src/or/dirvote.c b/src/or/dirvote.c index 1e19f65534..c6472a1a89 100644 --- a/src/or/dirvote.c +++ b/src/or/dirvote.c @@ -1080,8 +1080,6 @@ static struct { void dirvote_recalculate_timing(time_t now) { - /* XXXX020 call this when inputs may have changed (i.e., whenver we get a - * fresh consensus.) */ int interval, vote_delay, dist_delay; time_t start; time_t end; @@ -1361,6 +1359,7 @@ dirvote_add_vote(const char *vote_body, const char **msg_out, int *status_out) again: vote = networkstatus_parse_vote_from_string(vote_body, &end_of_vote, 1); if (!vote) { + log_warn(LD_DIR, "Couldn't parse vote: length was %d", strlen(vote_body)); *msg_out = "Unable to parse vote"; goto err; } diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c index b747d27979..b65d434468 100644 --- a/src/or/networkstatus.c +++ b/src/or/networkstatus.c @@ -1015,6 +1015,7 @@ networkstatus_set_current_consensus(const char *consensus, int from_cache, current_consensus = c; update_consensus_networkstatus_fetch_time(now); + dirvote_recalculate_timing(now); if (!from_cache) { or_options_t *options = get_options(); |