aboutsummaryrefslogtreecommitdiff
path: root/src/feature/nodelist/routerlist.c
diff options
context:
space:
mode:
authorteor <teor@riseup.net>2020-05-11 17:21:47 +1000
committerteor <teor@riseup.net>2020-05-18 21:53:52 +1000
commit280195f41471862964f5c47446e5ccd01afdd96b (patch)
tree1fd7945b0d7389d1aca6dd4f7ba554d8b37c6c4d /src/feature/nodelist/routerlist.c
parentce11e3bf6946d1659e5915abac30b1972fc799c8 (diff)
downloadtor-280195f41471862964f5c47446e5ccd01afdd96b.tar.gz
tor-280195f41471862964f5c47446e5ccd01afdd96b.zip
nodelist: Move the v3 onion service rendezvous check
And delete a loop that is now empty. This change should improve tor's performance, because we no longer iterate through the nodelist twice for every node in every circuit path. Part of 34200.
Diffstat (limited to 'src/feature/nodelist/routerlist.c')
-rw-r--r--src/feature/nodelist/routerlist.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/feature/nodelist/routerlist.c b/src/feature/nodelist/routerlist.c
index c18051d416..d4dfffa1ab 100644
--- a/src/feature/nodelist/routerlist.c
+++ b/src/feature/nodelist/routerlist.c
@@ -520,6 +520,7 @@ router_add_running_nodes_to_smartlist(smartlist_t *sl, int need_uptime,
int need_capacity, int need_guard,
int need_desc, int pref_addr,
int direct_conn,
+ bool rendezvous_v3,
bool initiate_ipv6_extend)
{
const int check_reach = !router_or_conn_should_skip_reachable_address_check(
@@ -546,6 +547,11 @@ router_add_running_nodes_to_smartlist(smartlist_t *sl, int need_uptime,
* 0.3.1.0-alpha. */
if (node_allows_single_hop_exits(node))
continue;
+ /* Exclude relays that can not become a rendezvous for a hidden service
+ * version 3. */
+ if (rendezvous_v3 &&
+ !node_supports_v3_rendezvous_point(node))
+ continue;
/* Choose a node with an OR address that matches the firewall rules */
if (direct_conn && check_reach &&
!fascist_firewall_allows_node(node,