[or-cvs] r11104: Actually upload signatures when we vote. log more about the (in tor/trunk: . src/or)

nickm at seul.org nickm at seul.org
Tue Aug 14 14:30:45 UTC 2007


Author: nickm
Date: 2007-08-14 10:30:45 -0400 (Tue, 14 Aug 2007)
New Revision: 11104

Modified:
   tor/trunk/
   tor/trunk/src/or/dirvote.c
Log:
 r14011 at 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.



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r14011] on c95137ef-5f19-0410-b913-86e773d04f59

Modified: tor/trunk/src/or/dirvote.c
===================================================================
--- tor/trunk/src/or/dirvote.c	2007-08-14 14:30:33 UTC (rev 11103)
+++ tor/trunk/src/or/dirvote.c	2007-08-14 14:30:45 UTC (rev 11104)
@@ -1081,7 +1081,7 @@
   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 @@
                       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 @@
     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 @@
 {
   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 @@
     log_warn(LD_DIR, "Error publishing consensus");
   else
     log_warn(LD_DIR, "Consensus published.");
+
   return 0;
 }
 



More information about the tor-commits mailing list