Recompute voting schedule whenever a consensus is set.
svn:r11808
- 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
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;
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;
}
current_consensus = c;
update_consensus_networkstatus_fetch_time(now);
+ dirvote_recalculate_timing(now);
if (!from_cache) {
or_options_t *options = get_options();