aboutsummaryrefslogtreecommitdiff
path: root/src/or/routerlist.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-03-30 15:59:32 +0000
committerNick Mathewson <nickm@torproject.org>2008-03-30 15:59:32 +0000
commit72ca7e5d88ab083d3cb04ab6f965bb7e655f28c2 (patch)
tree4ee62b03062e4f8f3326122ab91b6d18493d027f /src/or/routerlist.c
parent3b0be16e3b4c4e249c8fbd07b9242ae434ad86db (diff)
downloadtor-72ca7e5d88ab083d3cb04ab6f965bb7e655f28c2.tar.gz
tor-72ca7e5d88ab083d3cb04ab6f965bb7e655f28c2.zip
r19138@catbus: nickm | 2008-03-30 11:59:26 -0400
oops; fix bug in descriptor metric logic. svn:r14245
Diffstat (limited to 'src/or/routerlist.c')
-rw-r--r--src/or/routerlist.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index c7c701bae3..46248fb67b 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -2265,17 +2265,25 @@ dump_routerlist_mem_usage(int severity)
char last_valid_until[ISO_TIME_LEN+1];
char last_served_at[ISO_TIME_LEN+1];
char id[HEX_DIGEST_LEN+1];
+ routerstatus_t *rs;
format_iso_time(published, sd->published_on);
format_iso_time(last_valid_until, sd->last_listed_as_valid_until);
format_iso_time(last_served_at, sd->last_served_at);
base16_encode(id, sizeof(id), sd->identity_digest, DIGEST_LEN);
SMARTLIST_FOREACH(networkstatus_v2_list, networkstatus_v2_t *, ns,
- if (networkstatus_v2_find_entry(ns, sd->identity_digest)) {
- in_v2 = 1; break;
+ {
+ rs = networkstatus_v2_find_entry(ns, sd->identity_digest);
+ if (rs && !memcmp(rs->descriptor_digest,
+ sd->signed_descriptor_digest, DIGEST_LEN)) {
+ in_v2 = 1; break;
+ }
});
- if (consensus && networkstatus_vote_find_entry(consensus,
- sd->identity_digest))
- in_v3 = 1;
+ if (consensus) {
+ rs = networkstatus_vote_find_entry(consensus, sd->identity_digest);
+ if (rs && !memcmp(rs->descriptor_digest,
+ sd->signed_descriptor_digest, DIGEST_LEN))
+ in_v3 = 1;
+ }
log(severity, LD_DIR,
"Old descriptor for %s (published %s) %sin v2 ns, %sin v3 "
"consensus. Last valid until %s; last served at %s.",