diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-04-22 19:44:27 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-04-22 19:44:27 -0400 |
commit | 6773102c92e7bd9d949251da75bcc0762e754ab2 (patch) | |
tree | 310631258357320bbee56d488b6397d5facbb554 /src/or/routerlist.c | |
parent | d8ac7d557c0af199d21639a52a8c8c9dd201f555 (diff) | |
parent | 0941c8bfe6f34024153ae3ed67e4b1a05f9a6bfe (diff) | |
download | tor-6773102c92e7bd9d949251da75bcc0762e754ab2.tar.gz tor-6773102c92e7bd9d949251da75bcc0762e754ab2.zip |
Merge branch 'bug25691_033_again_squashed'
Diffstat (limited to 'src/or/routerlist.c')
-rw-r--r-- | src/or/routerlist.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c index bc3abb236f..1bfbd9f670 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; @@ -2758,7 +2758,7 @@ frac_nodes_with_descriptors(const smartlist_t *sl, total <= 0.0) { int n_with_descs = 0; SMARTLIST_FOREACH(sl, const node_t *, node, { - if (node_has_descriptor(node)) + if (node_has_any_descriptor(node)) n_with_descs++; }); return ((double)n_with_descs) / (double)smartlist_len(sl); @@ -2766,7 +2766,7 @@ frac_nodes_with_descriptors(const smartlist_t *sl, present = 0.0; SMARTLIST_FOREACH_BEGIN(sl, const node_t *, node) { - if (node_has_descriptor(node)) + if (node_has_any_descriptor(node)) present += bandwidths[node_sl_idx]; } SMARTLIST_FOREACH_END(node); |