aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2008-06-07 05:00:06 +0000
committerRoger Dingledine <arma@torproject.org>2008-06-07 05:00:06 +0000
commitb4d697688ec0c8d876037c0d882074d4db460fc1 (patch)
tree4d28b916b1a9dd057cb6ba9423e4e33b2dcaf87d
parentebab48769d31fcd168db3c840bc1bbd6561464e2 (diff)
downloadtor-b4d697688ec0c8d876037c0d882074d4db460fc1.tar.gz
tor-b4d697688ec0c8d876037c0d882074d4db460fc1.zip
revert r14970, since it didn't fix anything.
leave r14971 in place though. svn:r15005
-rw-r--r--src/or/routerlist.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index ca3cb6c0db..5bd00f7b39 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -4174,12 +4174,10 @@ get_dir_info_status_string(void)
static void
update_router_have_minimum_dir_info(void)
{
- int num_present = 0, num_usable=0, num_running=0;
+ int num_present = 0, num_usable=0;
time_t now = time(NULL);
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);
@@ -4206,26 +4204,23 @@ update_router_have_minimum_dir_info(void)
{
if (client_would_use_router(rs, now, options)) {
++num_usable; /* the consensus says we want 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)) {
+ if (router_get_by_descriptor_digest(rs->descriptor_digest)) {
/* we have the descriptor listed in the consensus. */
++num_present;
- if (ri->is_running)
- ++num_running; /* our local status says it's still up. */
}
}
});
+ log_debug(LD_DIR, "%d usable, %d present.", num_usable, num_present);
+
if (num_present < num_usable/4) {
tor_snprintf(dir_info_status, sizeof(dir_info_status),
"We have only %d/%d usable descriptors.", num_present, num_usable);
res = 0;
- } else if (num_running < 2) {
+ } else if (num_present < 2) {
tor_snprintf(dir_info_status, sizeof(dir_info_status),
- "Only %d descriptor%s believed reachable!", num_running,
- num_running ? "" : "s");
+ "Only %d descriptor%s here and believed reachable!",
+ num_present, num_present ? "" : "s");
res = 0;
} else {
res = 1;