[tor-commits] [tor/maint-0.3.3] Use node_has_preferred_descriptor() in another case

nickm at torproject.org nickm at torproject.org
Sun May 27 14:05:03 UTC 2018


commit 388d217c40fea4dfd9c2782ae6036126258fc292
Author: Nick Mathewson <nickm at torproject.org>
Date:   Mon Apr 16 11:40:14 2018 -0400

    Use node_has_preferred_descriptor() in another case
    
    In router_add_running_nodes_to_smartlist(), we had an inline
    implementation of the logic from node_has_descriptor(), which should
    be changed to node_has_preferred_descriptor().
---
 src/or/routerlist.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index bc3abb236..2ab5017b7 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -2335,7 +2335,7 @@ router_add_running_nodes_to_smartlist(smartlist_t *sl, int need_uptime,
   SMARTLIST_FOREACH_BEGIN(nodelist_get_list(), const node_t *, node) {
     if (!node->is_running || !node->is_valid)
       continue;
-    if (need_desc && !(node->ri || (node->rs && node->md)))
+    if (need_desc && !node_has_preferred_descriptor(node, direct_conn))
       continue;
     if (node->ri && node->ri->purpose != ROUTER_PURPOSE_GENERAL)
       continue;





More information about the tor-commits mailing list