summaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorMike Perry <mikeperry-git@fscked.org>2010-02-22 18:43:13 -0800
committerMike Perry <mikeperry-git@fscked.org>2010-02-22 18:43:13 -0800
commitb3fde4d309fc49f9327ed7bfd9e6221a741b593f (patch)
tree78c2d638e438575079c914c4cfe3017b92dabede /src/or
parentbce0021d963219cf2c550eaeac3be86d9ebaf625 (diff)
downloadtor-b3fde4d309fc49f9327ed7bfd9e6221a741b593f.tar.gz
tor-b3fde4d309fc49f9327ed7bfd9e6221a741b593f.zip
Add consensus method #defines.
Diffstat (limited to 'src/or')
-rw-r--r--src/or/dirvote.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/or/dirvote.c b/src/or/dirvote.c
index ca75fb7404..50c6261eb6 100644
--- a/src/or/dirvote.c
+++ b/src/or/dirvote.c
@@ -41,6 +41,13 @@ static char *make_consensus_method_list(int low, int high, const char *sep);
/** The highest consensus method that we currently support. */
#define MAX_SUPPORTED_CONSENSUS_METHOD 9
+/** Lowest consensus method that contains a 'directory-footer' marker */
+#define MIN_METHOD_FOR_FOOTER 9
+
+/** Lowest consensus method that contains bandwidth weights */
+#define MIN_METHOD_FOR_BW_WEIGHTS 9
+
+/** Lowest consensus method that contains consensus params */
#define MIN_METHOD_FOR_PARAMS 7
/** Lowest consensus method that generates microdescriptors */
@@ -1506,7 +1513,7 @@ networkstatus_compute_consensus(smartlist_t *votes,
rs_out.bandwidth = median_uint32(bandwidths, num_bandwidths);
}
- if (consensus_method >= 9) {
+ if (consensus_method >= MIN_METHOD_FOR_BW_WEIGHTS) {
if (rs_out.has_bandwidth) {
T += rs_out.bandwidth;
if (is_exit && is_guard)
@@ -1676,13 +1683,13 @@ networkstatus_compute_consensus(smartlist_t *votes,
tor_free(measured_bws);
}
- if (consensus_method >= 9) {
+ if (consensus_method >= MIN_METHOD_FOR_FOOTER) {
/* Starting with consensus method 9, we clearly mark the directory
* footer region */
smartlist_add(chunks, tor_strdup("directory-footer\n"));
}
- if (consensus_method >= 9) {
+ if (consensus_method >= MIN_METHOD_FOR_BW_WEIGHTS) {
int64_t weight_scale = BW_WEIGHT_SCALE;
char *bw_weight_param = NULL;
@@ -1795,7 +1802,7 @@ networkstatus_compute_consensus(smartlist_t *votes,
return NULL;
}
// Verify balancing parameters
- if (consensus_method >= 9) {
+ if (consensus_method >= MIN_METHOD_FOR_BW_WEIGHTS) {
networkstatus_verify_bw_weights(c);
}
networkstatus_vote_free(c);