mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-11 13:43:47 +01:00
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.
This commit is contained in:
parent
dca8ae5cfa
commit
f5995692da
@ -2901,13 +2901,7 @@ entry_guard_t *
|
|||||||
entry_guard_get_by_id_digest_for_guard_selection(guard_selection_t *gs,
|
entry_guard_get_by_id_digest_for_guard_selection(guard_selection_t *gs,
|
||||||
const char *digest)
|
const char *digest)
|
||||||
{
|
{
|
||||||
tor_assert(gs != NULL);
|
return get_sampled_guard_with_id(gs, (const uint8_t*)digest);
|
||||||
|
|
||||||
SMARTLIST_FOREACH(gs->sampled_entry_guards, entry_guard_t *, entry,
|
|
||||||
if (tor_memeq(digest, entry->identity, DIGEST_LEN))
|
|
||||||
return entry;
|
|
||||||
);
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Return the node_t associated with a single entry_guard_t. May
|
/** Return the node_t associated with a single entry_guard_t. May
|
||||||
|
Loading…
Reference in New Issue
Block a user