diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-12-07 12:36:13 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-12-16 11:06:22 -0500 |
commit | 68679504323b0a676a446b8fb34b976c9dc66b4f (patch) | |
tree | 89a6a9621fae80e4c41114aee2d0f12aed437dcb /src/or/routerlist.c | |
parent | 2b4bfe62ee74b927d65923f5d07fe04f51f8779a (diff) | |
download | tor-68679504323b0a676a446b8fb34b976c9dc66b4f.tar.gz tor-68679504323b0a676a446b8fb34b976c9dc66b4f.zip |
Wrap all of the legacy guard code, and its users, in #ifdefs
This will make it easier to see what we remove down the line.
Diffstat (limited to 'src/or/routerlist.c')
-rw-r--r-- | src/or/routerlist.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c index d2f360a63f..cfa570c4a0 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -2003,6 +2003,10 @@ router_pick_directory_server_impl(dirinfo_type_t type, int flags, int try_excluding = 1, n_excluded = 0, n_busy = 0; int try_ip_pref = 1; +#ifndef ENABLE_LEGACY_GUARD_ALGORITHM + tor_assert_nonfatal(! for_guard); +#endif + if (!consensus) return NULL; @@ -2038,10 +2042,12 @@ router_pick_directory_server_impl(dirinfo_type_t type, int flags, if ((type & EXTRAINFO_DIRINFO) && !router_supports_extrainfo(node->identity, is_trusted_extrainfo)) continue; +#ifdef ENABLE_LEGACY_GUARD_ALGORITHM /* Don't make the same node a guard twice */ if (for_guard && is_node_used_as_guard(node)) { continue; } +#endif /* Ensure that a directory guard is actually a guard node. */ if (for_guard && !node->is_possible_guard) { continue; |