diff options
author | David Goulet <dgoulet@torproject.org> | 2016-05-03 11:36:09 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2016-07-01 14:01:41 -0400 |
commit | 0c26a6db7e683c23505c1c9187fd538c7b80ce31 (patch) | |
tree | a1ad7d2b48935a5f02a0abdf520e4e81a02f1268 /src/or/dirvote.c | |
parent | ca6ceec112f05ce68097429089ee428010c8b8d0 (diff) | |
download | tor-0c26a6db7e683c23505c1c9187fd538c7b80ce31.tar.gz tor-0c26a6db7e683c23505c1c9187fd538c7b80ce31.zip |
prop250: Parse votes and consensus
One of the last piece that parses the votes and consensus in order to update
our state and make decision for the SR values.
We need to inform the SR subsystem when we set the current consensus because
this can be called when loaded from file or downloaded from other authorities
or computed.
The voting schedule is used for the SR timings since we are bound to the
voting system.
Signed-off-by: David Goulet <dgoulet@torproject.org>
Signed-off-by: George Kadianakis <desnacked@riseup.net>
Diffstat (limited to 'src/or/dirvote.c')
-rw-r--r-- | src/or/dirvote.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/or/dirvote.c b/src/or/dirvote.c index af093deaf4..4eccdd0611 100644 --- a/src/or/dirvote.c +++ b/src/or/dirvote.c @@ -2668,6 +2668,9 @@ dirvote_act(const or_options_t *options, time_t now) dirvote_publish_consensus(); dirvote_clear_votes(0); voting_schedule.have_published_consensus = 1; + /* Update our shared random state with the consensus just published. */ + sr_act_post_consensus( + networkstatus_get_latest_consensus_by_flavor(FLAV_NS)); /* XXXX We will want to try again later if we haven't got enough * signatures yet. Implement this if it turns out to ever happen. */ dirvote_recalculate_timing(options, now); @@ -3007,6 +3010,10 @@ dirvote_add_vote(const char *vote_body, const char **msg_out, int *status_out) } } SMARTLIST_FOREACH_END(v); + /* This a valid vote, update our shared random state. */ + sr_handle_received_commits(vote->sr_info.commits, + vote->cert->identity_key); + pending_vote = tor_malloc_zero(sizeof(pending_vote_t)); pending_vote->vote_body = new_cached_dir(tor_strndup(vote_body, end_of_vote-vote_body), |