summaryrefslogtreecommitdiff
path: root/src/or/routerlist.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2008-06-05 11:37:40 +0000
committerRoger Dingledine <arma@torproject.org>2008-06-05 11:37:40 +0000
commitb65b89d50f9c84299cecd4e5f8ef5e078efe596a (patch)
treee86b9119c547ba723149b8f99ff59e7ca4a70dbe /src/or/routerlist.c
parentca416a78e3570a62bf471abde8432208a660f8c5 (diff)
downloadtor-b65b89d50f9c84299cecd4e5f8ef5e078efe596a.tar.gz
tor-b65b89d50f9c84299cecd4e5f8ef5e078efe596a.zip
make sure, when we're checking if we have enough dir info, that
we actually have the descriptor listed in the consensus, not just any descriptor, for each relay. don't backport this patch (yet); who knows what it might do. svn:r14971
Diffstat (limited to 'src/or/routerlist.c')
-rw-r--r--src/or/routerlist.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index b82f473c14..a40bf34867 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -4194,6 +4194,7 @@ update_router_have_minimum_dir_info(void)
int res;
or_options_t *options = get_options();
routerinfo_t *ri;
+ signed_descriptor_t *sd;
const networkstatus_t *consensus =
networkstatus_get_reasonably_live_consensus(now);
@@ -4220,10 +4221,12 @@ update_router_have_minimum_dir_info(void)
{
if (client_would_use_router(rs, now, options)) {
++num_usable; /* the consensus says we want it. */
- /* XXX021 shouldn't we look up by descriptor digest? */
- ri = router_get_by_digest(rs->identity_digest);
- if (ri) {
- ++num_present; /* we have some descriptor for it. */
+ if ((sd = router_get_by_descriptor_digest(rs->descriptor_digest)) &&
+ (ri = router_get_by_digest(rs->identity_digest)) &&
+ !memcmp(ri->cache_info.signed_descriptor_digest,
+ sd->signed_descriptor_digest, DIGEST_LEN)) {
+ /* we have the descriptor listed in the consensus. */
+ ++num_present;
if (ri->is_running)
++num_running; /* our local status says it's still up. */
}