diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-08-14 14:30:45 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-08-14 14:30:45 +0000 |
commit | 925394022ab456ea32d6ea382e413886b03a6dbb (patch) | |
tree | cb3e107b38eaf16f7ff13a7a79d044dc5a500475 /src/or/dirvote.c | |
parent | 944bc41f9962cfdeb7745f00ab6b5e808e56db86 (diff) | |
download | tor-925394022ab456ea32d6ea382e413886b03a6dbb.tar tor-925394022ab456ea32d6ea382e413886b03a6dbb.tar.gz |
r14011@Kushana: nickm | 2007-08-14 10:29:49 -0400
Actually upload signatures when we vote. log more about the signatures we get. discard pending vote stuff after we publish.
svn:r11104
Diffstat (limited to 'src/or/dirvote.c')
-rw-r--r-- | src/or/dirvote.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/or/dirvote.c b/src/or/dirvote.c index 30dcbe3bc..d22d73eee 100644 --- a/src/or/dirvote.c +++ b/src/or/dirvote.c @@ -1081,7 +1081,7 @@ dirvote_recalculate_timing(time_t now) voting_schedule.voting_ends = start - vote_delay; voting_schedule.voting_starts = start - vote_delay - dist_delay; - voting_schedule.discard_old_votes = start + 600; /* XXXX020 */ + voting_schedule.discard_old_votes = start + 300; /* XXXX020 */ } /** DOCDOC */ @@ -1180,6 +1180,13 @@ dirvote_clear_pending_votes(void) tor_free(cp)); smartlist_clear(pending_consensus_signature_list); } + tor_free(pending_consensus_body); + tor_free(pending_consensus_signatures); + if (pending_consensus) { + networkstatus_vote_free(pending_consensus); + pending_consensus = NULL; + } + log_notice(LD_DIR, "Pending votes cleared."); } @@ -1349,7 +1356,15 @@ dirvote_compute_consensus(void) smartlist_clear(pending_consensus_signature_list); } - log_notice(LD_DIR, "Consensus computed."); + log_notice(LD_DIR, "Consensus computed; uploading signature(s)"); + + directory_post_to_dirservers(DIR_PURPOSE_UPLOAD_SIGNATURES, + ROUTER_PURPOSE_GENERAL, + V3_AUTHORITY, + pending_consensus_signatures, + strlen(pending_consensus_signatures), 0); + log_notice(LD_DIR, "Signature(s) posted."); + return 0; err: if (votes) @@ -1424,9 +1439,11 @@ dirvote_add_signatures(const char *detached_signatures_body) { if (pending_consensus) { const char *msg=NULL; + log_notice(LD_DIR, "Got a signature. Adding it to the pending consensus."); return dirvote_add_signatures_to_pending_consensus( detached_signatures_body, &msg); } else { + log_notice(LD_DIR, "Got a signature. Queueing it for the next consensus."); if (!pending_consensus_signature_list) pending_consensus_signature_list = smartlist_create(); smartlist_add(pending_consensus_signature_list, @@ -1450,6 +1467,7 @@ dirvote_publish_consensus(void) log_warn(LD_DIR, "Error publishing consensus"); else log_warn(LD_DIR, "Consensus published."); + return 0; } |