if (!voting_schedule.voting_starts)
dirvote_recalculate_timing(now);
if (voting_schedule.voting_starts < now && !voting_schedule.have_voted) {
+ log_notice(LD_DIR, "Time to vote.");
dirvote_perform_vote();
voting_schedule.have_voted = 1;
}
/* XXXX020 after a couple minutes here, start trying to fetch votes. */
if (voting_schedule.voting_ends < now &&
!voting_schedule.have_built_consensus) {
+ log_notice(LD_DIR, "Time to compute a consensus.");
dirvote_compute_consensus();
/* XXXX020 we will want to try again later if we haven't got enough
* votes yet. */
}
if (voting_schedule.interval_starts < now &&
!voting_schedule.have_published_consensus) {
+ log_notice(LD_DIR, "Time to publish the consensus.");
dirvote_publish_consensus();
/* XXXX020 we will want to try again later if we haven't got enough
* signatures yet. */
voting_schedule.have_published_consensus = 1;
}
if (voting_schedule.discard_old_votes < now) {
+ log_notice(LD_DIR, "Time to discard old votes consensus.");
dirvote_clear_pending_votes();
dirvote_recalculate_timing(now);
}
V3_AUTHORITY,
pending_vote->vote_body->dir,
pending_vote->vote_body->dir_len, 0);
+ log_notice(LD_DIR, "Vote posted.");
}
/** DOCDOC */
tor_free(cp));
smartlist_clear(pending_consensus_signature_list);
}
+ log_notice(LD_DIR, "Pending votes cleared.");
}
/** DOCDOC */
smartlist_clear(pending_consensus_signature_list);
}
+ log_notice(LD_DIR, "Consensus computed.");
return 0;
err:
if (votes)
{
/* Can we actually publish it yet? */
if (!pending_consensus ||
- networkstatus_check_consensus_signature(pending_consensus)<0)
+ networkstatus_check_consensus_signature(pending_consensus)<0) {
+ log_warn(LD_DIR, "Not enough info to publish pending consensus");
return -1;
+ }
- networkstatus_set_current_consensus(pending_consensus_body, 0);
+ if (networkstatus_set_current_consensus(pending_consensus_body, 0))
+ log_warn(LD_DIR, "Error publishing consensus");
+ else
+ log_warn(LD_DIR, "Consensus published.");
return 0;
}
networkstatus_vote_t *c;
/* Make sure it's parseable. */
c = networkstatus_parse_vote_from_string(consensus, 0);
- if (!c)
+ if (!c) {
+ log_warn(LD_DIR, "Unable to parse networkstatus consensus");
return -1;
+ }
/* Make sure it's signed enough. */
if (networkstatus_check_consensus_signature(c)<0) {
+ log_warn(LD_DIR, "Not enough good signatures on networkstatus consensus");
networkstatus_vote_free(c);
return -1;
}