diff options
Diffstat (limited to 'src/or/routerlist.c')
-rw-r--r-- | src/or/routerlist.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c index 6382248e4..7f8151b59 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -5055,26 +5055,39 @@ hid_serv_get_introduction_points(smartlist_t *introduction_points, int start, found, i; networkstatus_t *c = networkstatus_get_latest_consensus(); + if (!c || !smartlist_len(c->routerstatus_list)) { log_warn(LD_REND, "We don't have a consensus, so determine introduction " "points"); return -1; } + tor_assert(id); + start = networkstatus_vote_find_entry_idx(c, id, &found); - if (start == smartlist_len(c->routerstatus_list)) start = 0; + + if (start == smartlist_len(c->routerstatus_list)) + start = 0; + i = start; + do { routerstatus_t *r = smartlist_get(c->routerstatus_list, i); node_t *node = node_get_by_id(r->identity_digest); - if (!excludedsmartlist || !smartlist_contains(excludedsmartlist, node)) { + log_info(LD_REND, "considering node %s", + safe_str_client(node_describe(node))); + + if ((!excludedsmartlist || !smartlist_contains(excludedsmartlist, node)) && + node->is_stable && + (node->ri || (node->rs && node->md))) { + smartlist_add(introduction_points, node); if (--number <= 0) return 0; } else { - log_warn(LD_REND, "Ignoring node %s ", + log_info(LD_REND, "ignoring node %s ", safe_str_client(node_describe(node))); } |