mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-25 07:07:52 +01:00
Remove dead code in networkstatus.c
We can't end up in the removed else {} condition since we first validate the flavor we get and then we validate the flavor we parse from the given consensus which means we can only handle the two flavors of the if/elseif conditions. Fixes #25914 Signed-off-by: David Goulet <dgoulet@torproject.org>
This commit is contained in:
parent
a052eea480
commit
1a181a476e
1 changed files with 3 additions and 11 deletions
|
@ -1841,17 +1841,9 @@ networkstatus_set_current_consensus(const char *consensus,
|
||||||
current_valid_after = current_md_consensus->valid_after;
|
current_valid_after = current_md_consensus->valid_after;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cached_dir_t *cur;
|
tor_assert_nonfatal_unreached();
|
||||||
char buf[128];
|
result = -2;
|
||||||
tor_snprintf(buf, sizeof(buf), "cached-%s-consensus", flavor);
|
goto done;
|
||||||
consensus_fname = get_cachedir_fname(buf);
|
|
||||||
tor_snprintf(buf, sizeof(buf), "unverified-%s-consensus", flavor);
|
|
||||||
unverified_fname = get_cachedir_fname(buf);
|
|
||||||
cur = dirserv_get_consensus(flavor);
|
|
||||||
if (cur) {
|
|
||||||
current_digests = &cur->digests;
|
|
||||||
current_valid_after = cur->published;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (current_digests &&
|
if (current_digests &&
|
||||||
|
|
Loading…
Add table
Reference in a new issue