|
@@ -3040,6 +3040,26 @@ dirvote_compute_consensuses(void)
|
|
|
if (!pending_vote_list)
|
|
|
pending_vote_list = smartlist_new();
|
|
|
|
|
|
+
|
|
|
+ * the consensus process below. */
|
|
|
+ votes = smartlist_new();
|
|
|
+ votestrings = smartlist_new();
|
|
|
+ SMARTLIST_FOREACH(pending_vote_list, pending_vote_t *, v,
|
|
|
+ {
|
|
|
+ sized_chunk_t *c = tor_malloc(sizeof(sized_chunk_t));
|
|
|
+ c->bytes = v->vote_body->dir;
|
|
|
+ c->len = v->vote_body->dir_len;
|
|
|
+ smartlist_add(votestrings, c);
|
|
|
+
|
|
|
+ smartlist_add(votes, v->vote);
|
|
|
+ });
|
|
|
+
|
|
|
+ votefile = get_datadir_fname("v3-status-votes");
|
|
|
+ write_chunks_to_file(votefile, votestrings, 0, 0);
|
|
|
+ tor_free(votefile);
|
|
|
+ SMARTLIST_FOREACH(votestrings, sized_chunk_t *, c, tor_free(c));
|
|
|
+ smartlist_free(votestrings);
|
|
|
+
|
|
|
n_voters = get_n_authorities(V3_DIRINFO);
|
|
|
n_votes = smartlist_len(pending_vote_list);
|
|
|
if (n_votes <= n_voters/2) {
|
|
@@ -3066,24 +3086,6 @@ dirvote_compute_consensuses(void)
|
|
|
goto err;
|
|
|
}
|
|
|
|
|
|
- votes = smartlist_new();
|
|
|
- votestrings = smartlist_new();
|
|
|
- SMARTLIST_FOREACH(pending_vote_list, pending_vote_t *, v,
|
|
|
- {
|
|
|
- sized_chunk_t *c = tor_malloc(sizeof(sized_chunk_t));
|
|
|
- c->bytes = v->vote_body->dir;
|
|
|
- c->len = v->vote_body->dir_len;
|
|
|
- smartlist_add(votestrings, c);
|
|
|
-
|
|
|
- smartlist_add(votes, v->vote);
|
|
|
- });
|
|
|
-
|
|
|
- votefile = get_datadir_fname("v3-status-votes");
|
|
|
- write_chunks_to_file(votefile, votestrings, 0, 0);
|
|
|
- tor_free(votefile);
|
|
|
- SMARTLIST_FOREACH(votestrings, sized_chunk_t *, c, tor_free(c));
|
|
|
- smartlist_free(votestrings);
|
|
|
-
|
|
|
{
|
|
|
char legacy_dbuf[DIGEST_LEN];
|
|
|
crypto_pk_t *legacy_sign=NULL;
|