aboutsummaryrefslogtreecommitdiff
path: root/src/or/networkstatus.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-09-08 12:18:22 -0400
committerNick Mathewson <nickm@torproject.org>2017-09-08 12:18:22 -0400
commit2df7f1d59dcf613725ff5273cc792f93fb2e3031 (patch)
treeecc34e3180691af588b409151a4bf3f28ddb6196 /src/or/networkstatus.c
parentca19a95d5402e2f74e027761223f6d7605534c2c (diff)
parent80d3887360548b28fe2bd06501f0d51d0a1ba4f0 (diff)
downloadtor-2df7f1d59dcf613725ff5273cc792f93fb2e3031.tar.gz
tor-2df7f1d59dcf613725ff5273cc792f93fb2e3031.zip
Merge branch 'ed25519_lookup'
Diffstat (limited to 'src/or/networkstatus.c')
-rw-r--r--src/or/networkstatus.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c
index e25a3d316a..76e8fe792a 100644
--- a/src/or/networkstatus.c
+++ b/src/or/networkstatus.c
@@ -794,21 +794,6 @@ router_get_consensus_status_by_id(const char *digest)
return router_get_mutable_consensus_status_by_id(digest);
}
-/** Given a nickname (possibly verbose, possibly a hexadecimal digest), return
- * the corresponding routerstatus_t, or NULL if none exists. Warn the
- * user if <b>warn_if_unnamed</b> is set, and they have specified a router by
- * nickname, but the Named flag isn't set for that router. */
-const routerstatus_t *
-router_get_consensus_status_by_nickname(const char *nickname,
- int warn_if_unnamed)
-{
- const node_t *node = node_get_by_nickname(nickname, warn_if_unnamed);
- if (node)
- return node->rs;
- else
- return NULL;
-}
-
/** Return the identity digest that's mapped to officially by
* <b>nickname</b>. */
const char *
@@ -2556,7 +2541,8 @@ getinfo_helper_networkstatus(control_connection_t *conn,
}
status = router_get_consensus_status_by_id(d);
} else if (!strcmpstart(question, "ns/name/")) {
- status = router_get_consensus_status_by_nickname(question+8, 0);
+ const node_t *n = node_get_by_nickname(question+8, 0);
+ status = n ? n->rs : NULL;
} else if (!strcmpstart(question, "ns/purpose/")) {
*answer = networkstatus_getinfo_by_purpose(question+11, time(NULL));
return *answer ? 0 : -1;