aboutsummaryrefslogtreecommitdiff
path: root/src/or/shared_random.h
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2016-05-03 11:21:17 -0400
committerDavid Goulet <dgoulet@torproject.org>2016-07-01 13:25:03 -0400
commitca6ceec112f05ce68097429089ee428010c8b8d0 (patch)
treea297cc544c7f354a458a1712d7e2d101fcb6aa0b /src/or/shared_random.h
parent5b183328fdd4bf81a3a38afe88d2766e61773fb9 (diff)
downloadtor-ca6ceec112f05ce68097429089ee428010c8b8d0.tar.gz
tor-ca6ceec112f05ce68097429089ee428010c8b8d0.zip
prop250: Put commits and SRVs in votes/consensus
This commit adds the commit(s) line in the vote as well as the SR values. It also has the mechanism to add the majority SRVs in the consensus. Signed-off-by: George Kadianakis <desnacked@riseup.net> Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/shared_random.h')
-rw-r--r--src/or/shared_random.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/or/shared_random.h b/src/or/shared_random.h
index 878bfbff45..f1fbe273f1 100644
--- a/src/or/shared_random.h
+++ b/src/or/shared_random.h
@@ -101,13 +101,15 @@ typedef struct sr_commit_t {
int sr_init(int save_to_disk);
void sr_save_and_cleanup(void);
+sr_commit_t *sr_parse_commit(const smartlist_t *args);
+sr_srv_t *sr_parse_srv(const smartlist_t *args);
+char *sr_get_string_for_vote(void);
+char *sr_get_string_for_consensus(const smartlist_t *votes);
void sr_commit_free(sr_commit_t *commit);
void sr_srv_encode(char *dst, const sr_srv_t *srv);
/* Private methods (only used by shared_random_state.c): */
-sr_commit_t *sr_parse_commit(const smartlist_t *args);
-sr_srv_t *sr_parse_srv(const smartlist_t *args);
void sr_compute_srv(void);
sr_commit_t *sr_generate_our_commit(time_t timestamp,
const authority_cert_t *my_rsa_cert);
@@ -123,6 +125,9 @@ STATIC int reveal_decode(const char *encoded, sr_commit_t *commit);
STATIC int commit_has_reveal_value(const sr_commit_t *commit);
+STATIC sr_srv_t *get_majority_srv_from_votes(const smartlist_t *votes,
+ int current);
+
#endif /* SHARED_RANDOM_PRIVATE */
#endif /* TOR_SHARED_RANDOM_H */