diff options
author | David Goulet <dgoulet@torproject.org> | 2016-05-26 15:26:09 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2016-07-01 14:01:42 -0400 |
commit | 4a1904c12665b98c356aba8e7b73a3f3fd508a5b (patch) | |
tree | 0e5e943203291f0926323c5e610610afed8a0325 /src/or/dirvote.c | |
parent | 6927467bef1b5c46b85d30ac77b364ed407f6d72 (diff) | |
download | tor-4a1904c12665b98c356aba8e7b73a3f3fd508a5b.tar.gz tor-4a1904c12665b98c356aba8e7b73a3f3fd508a5b.zip |
prop250: Use the new dirvote_get_intermediate_param_value for AuthDirNumSRVAgreements
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/dirvote.c')
-rw-r--r-- | src/or/dirvote.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/or/dirvote.c b/src/or/dirvote.c index 4ebea3262c..4fbd6b339f 100644 --- a/src/or/dirvote.c +++ b/src/or/dirvote.c @@ -1341,8 +1341,16 @@ networkstatus_compute_consensus(smartlist_t *votes, } if (consensus_method >= MIN_METHOD_FOR_SHARED_RANDOM) { + int num_dirauth = get_n_authorities(V3_DIRINFO); + /* Default value of this is 2/3 of the total number of authorities. For + * instance, if we have 9 dirauth, the default value is 6. The following + * calculation will round it down. */ + int32_t num_srv_agreements = + dirvote_get_intermediate_param_value(param_list, + "AuthDirNumSRVAgreements", + (num_dirauth * 2) / 3); /* Add the shared random value. */ - char *srv_lines = sr_get_string_for_consensus(votes); + char *srv_lines = sr_get_string_for_consensus(votes, num_srv_agreements); if (srv_lines != NULL) { smartlist_add(chunks, srv_lines); } |