aboutsummaryrefslogtreecommitdiff
path: root/src/or/networkstatus.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2018-04-25 09:35:32 -0400
committerDavid Goulet <dgoulet@torproject.org>2018-04-25 09:35:32 -0400
commit1a181a476e623cd6c1bc71173bb2d3d769aa1325 (patch)
treedc9109aa866696157252408c05ce56e5a5925396 /src/or/networkstatus.c
parenta052eea4803808d4da09ef8728de22344d1241be (diff)
downloadtor-1a181a476e623cd6c1bc71173bb2d3d769aa1325.tar.gz
tor-1a181a476e623cd6c1bc71173bb2d3d769aa1325.zip
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>
Diffstat (limited to 'src/or/networkstatus.c')
-rw-r--r--src/or/networkstatus.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c
index b0db0cecbc..d545ac120a 100644
--- a/src/or/networkstatus.c
+++ b/src/or/networkstatus.c
@@ -1841,17 +1841,9 @@ networkstatus_set_current_consensus(const char *consensus,
current_valid_after = current_md_consensus->valid_after;
}
} else {
- cached_dir_t *cur;
- char buf[128];
- tor_snprintf(buf, sizeof(buf), "cached-%s-consensus", flavor);
- 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;
- }
+ tor_assert_nonfatal_unreached();
+ result = -2;
+ goto done;
}
if (current_digests &&