diff options
Diffstat (limited to 'src/or/routerlist.c')
-rw-r--r-- | src/or/routerlist.c | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c index 7f8151b59..2db72722d 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -5046,60 +5046,6 @@ hid_serv_get_responsible_directories(smartlist_t *responsible_dirs, return smartlist_len(responsible_dirs) ? 0 : -1; } -int -hid_serv_get_introduction_points(smartlist_t *introduction_points, - int number, - smartlist_t *excludedsmartlist, - const char *id) -{ - 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; - - i = start; - - do { - routerstatus_t *r = smartlist_get(c->routerstatus_list, i); - - node_t *node = node_get_by_id(r->identity_digest); - - 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_info(LD_REND, "ignoring node %s ", - safe_str_client(node_describe(node))); - } - - if (++i == smartlist_len(c->routerstatus_list)) - i = 0; - } while (i != start); - - /* Even though we don't have the desired number of hidden service - * directories, be happy if we got any. */ - return smartlist_len(introduction_points) ? 0 : -1; -} - /** Return true if this node is currently acting as hidden service * directory, false otherwise. */ int |