diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-02-14 10:28:54 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-02-14 10:28:54 -0500 |
commit | f5995692dadf9bc038455d7e701be84937f28d82 (patch) | |
tree | 2ab44f7846974e64c9895fce2b2cc58e4264a583 /src/or/entrynodes.c | |
parent | dca8ae5cfa8b081230d033158c980d50840b072a (diff) | |
download | tor-f5995692dadf9bc038455d7e701be84937f28d82.tar.gz tor-f5995692dadf9bc038455d7e701be84937f28d82.zip |
Replace entry_guard_get_by_id_digest_for_guard_selection impl.
We already implemented this whole function somewhere else; no need
to have the same code twice.
Diffstat (limited to 'src/or/entrynodes.c')
-rw-r--r-- | src/or/entrynodes.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/or/entrynodes.c b/src/or/entrynodes.c index 3bb5169355..93dd2bd59c 100644 --- a/src/or/entrynodes.c +++ b/src/or/entrynodes.c @@ -2901,13 +2901,7 @@ entry_guard_t * entry_guard_get_by_id_digest_for_guard_selection(guard_selection_t *gs, const char *digest) { - tor_assert(gs != NULL); - - SMARTLIST_FOREACH(gs->sampled_entry_guards, entry_guard_t *, entry, - if (tor_memeq(digest, entry->identity, DIGEST_LEN)) - return entry; - ); - return NULL; + return get_sampled_guard_with_id(gs, (const uint8_t*)digest); } /** Return the node_t associated with a single entry_guard_t. May |