diff options
author | Nick Mathewson <nickm@torproject.org> | 2008-07-24 09:22:27 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2008-07-24 09:22:27 +0000 |
commit | dff1ef7d06d1f7e540be2b10e66538ab7eac3f76 (patch) | |
tree | ea39b55cfdaf59783ece60545f253951968d9d8e /src/or/networkstatus.c | |
parent | ea95ce25b63e6a291d9c816308919caf887fa7ea (diff) | |
download | tor-dff1ef7d06d1f7e540be2b10e66538ab7eac3f76.tar.gz tor-dff1ef7d06d1f7e540be2b10e66538ab7eac3f76.zip |
r17337@aud-055: nickm | 2008-07-24 10:17:43 +0200
Refactor the is_vote field of networkstatus_t to add a third possibility ("opinion") in addition to vote and opinion. First part of implementing proposal 147.
svn:r16166
Diffstat (limited to 'src/or/networkstatus.c')
-rw-r--r-- | src/or/networkstatus.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c index 6ae48e2a47..1c685b64c7 100644 --- a/src/or/networkstatus.c +++ b/src/or/networkstatus.c @@ -290,7 +290,7 @@ networkstatus_vote_free(networkstatus_t *ns) authority_cert_free(ns->cert); if (ns->routerstatus_list) { - if (ns->is_vote) { + if (ns->type == NS_TYPE_VOTE || ns->type == NS_TYPE_OPINION) { SMARTLIST_FOREACH(ns->routerstatus_list, vote_routerstatus_t *, rs, { tor_free(rs->version); @@ -382,7 +382,7 @@ networkstatus_check_consensus_signature(networkstatus_t *consensus, smartlist_t *missing_authorities = smartlist_create(); int severity; - tor_assert(! consensus->is_vote); + tor_assert(consensus->type == NS_TYPE_CONSENSUS); SMARTLIST_FOREACH(consensus->voters, networkstatus_voter_info_t *, voter, { @@ -1366,7 +1366,7 @@ networkstatus_set_current_consensus(const char *consensus, unsigned flags) const unsigned dl_certs = !(flags & NSSET_DONT_DOWNLOAD_CERTS); /* Make sure it's parseable. */ - c = networkstatus_parse_vote_from_string(consensus, NULL, 0); + c = networkstatus_parse_vote_from_string(consensus, NULL, NS_TYPE_CONSENSUS); if (!c) { log_warn(LD_DIR, "Unable to parse networkstatus consensus"); result = -2; |