Ensure node is a guard candidate when picking a directory guard

This commit is contained in:
Arlo Breault
2015-12-07 20:28:26 -08:00
committed by Nick Mathewson
parent b0867fec96
commit 5138f5ca69
2 changed files with 15 additions and 2 deletions
+8 -2
View File
@@ -1537,8 +1537,14 @@ router_pick_directory_server_impl(dirinfo_type_t type, int flags)
if ((type & MICRODESC_DIRINFO) && !is_trusted &&
!node->rs->version_supports_microdesc_cache)
continue;
if (for_guard && node->using_as_guard)
continue; /* Don't make the same node a guard twice. */
/* Don't make the same node a guard twice */
if (for_guard && node->using_as_guard) {
continue;
}
/* Ensure that a directory guard is actually a guard node. */
if (for_guard && !node->is_possible_guard) {
continue;
}
if (try_excluding &&
routerset_contains_routerstatus(options->ExcludeNodes, status,
country)) {