summaryrefslogtreecommitdiff
path: root/src/or/dirvote.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-08-26 14:14:34 -0400
committerNick Mathewson <nickm@torproject.org>2016-08-26 14:14:34 -0400
commit9b9fb63276c892690d57ce5598e2e577d7e5ad9f (patch)
tree08d04e1f26cde9522e8e2ef9d1e2c15c25442a2f /src/or/dirvote.c
parent8fe410e875343a4c134ddbe0db6da3d38865deee (diff)
downloadtor-9b9fb63276c892690d57ce5598e2e577d7e5ad9f.tar.gz
tor-9b9fb63276c892690d57ce5598e2e577d7e5ad9f.zip
prop272: When voting, include no non-Valid relays in consensus
Implements ticket 20002, and part of proposal 272.
Diffstat (limited to 'src/or/dirvote.c')
-rw-r--r--src/or/dirvote.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/or/dirvote.c b/src/or/dirvote.c
index 9748f4ae4d..ae869c9064 100644
--- a/src/or/dirvote.c
+++ b/src/or/dirvote.c
@@ -1582,7 +1582,7 @@ networkstatus_compute_consensus(smartlist_t *votes,
const char *chosen_version;
const char *chosen_name = NULL;
int exitsummary_disagreement = 0;
- int is_named = 0, is_unnamed = 0, is_running = 0;
+ int is_named = 0, is_unnamed = 0, is_running = 0, is_valid = 0;
int is_guard = 0, is_exit = 0, is_bad_exit = 0;
int naming_conflict = 0;
int n_listing = 0;
@@ -1733,6 +1733,8 @@ networkstatus_compute_consensus(smartlist_t *votes,
is_running = 1;
else if (!strcmp(fl, "BadExit"))
is_bad_exit = 1;
+ else if (!strcmp(fl, "Valid"))
+ is_valid = 1;
}
}
} SMARTLIST_FOREACH_END(fl);
@@ -1742,6 +1744,12 @@ networkstatus_compute_consensus(smartlist_t *votes,
if (!is_running)
continue;
+ /* Starting with consensus method 24, we don't list servers
+ * that are not valid in a consensus. See Proposal 272 */
+ if (!is_valid &&
+ consensus_method >= MIN_METHOD_FOR_EXCLUDING_INVALID_NODES)
+ continue;
+
/* Pick the version. */
if (smartlist_len(versions)) {
sort_version_list(versions, 0);