diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-12-07 14:15:38 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-12-16 11:06:22 -0500 |
commit | e50d85b90cb3fbc562517c11ded12940682ffec0 (patch) | |
tree | 7f9639dde5f85b19ed90235ad3750f6b4a981062 | |
parent | b7088e5b5add8bf3b6f783ec37ce7cd231476b35 (diff) | |
download | tor-e50d85b90cb3fbc562517c11ded12940682ffec0.tar.gz tor-e50d85b90cb3fbc562517c11ded12940682ffec0.zip |
Clean check for live consensus when updating the guard sample.
The valid_until check was redundant.
-rw-r--r-- | src/or/entrynodes.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/or/entrynodes.c b/src/or/entrynodes.c index ad9242e45f..f41464a4c9 100644 --- a/src/or/entrynodes.c +++ b/src/or/entrynodes.c @@ -1157,12 +1157,13 @@ sampled_guards_update_from_consensus(guard_selection_t *gs) if (gs->type != GS_TYPE_BRIDGE) { networkstatus_t *ns = networkstatus_get_live_consensus(approx_time()); - log_info(LD_GUARD, "Updating sampled guard status based on received " - "consensus."); - - if (! ns || ns->valid_until < approx_time()) { - log_info(LD_GUARD, "Hey, there wasn't a valid consensus. Ignoring"); + if (! ns) { + log_info(LD_GUARD, "No live consensus; can't update " + "sampled entry guards."); return; + } else { + log_info(LD_GUARD, "Updating sampled guard status based on received " + "consensus."); } } |