summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2006-01-03 13:09:49 +0000
committerRoger Dingledine <arma@torproject.org>2006-01-03 13:09:49 +0000
commitda06f3553c09a865f63be13fdd4367ad6f94c9cd (patch)
tree362368a5e86b847fee9b4c4a8b33c57c982075e9
parent03017191dd0ae521fe7e7e30fa8d877e534fd831 (diff)
downloadtor-da06f3553c09a865f63be13fdd4367ad6f94c9cd.tar.gz
tor-da06f3553c09a865f63be13fdd4367ad6f94c9cd.zip
don't try to build circuits until we have 3 running servers;
and for networks that are very small, having more than a quarter of the descriptors is much harder than having equal to or more than a quarter of the descriptors -- follow the spec. svn:r5720
-rw-r--r--src/or/routerlist.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 7d4d563006..ca07310535 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -3487,7 +3487,7 @@ update_router_descriptor_downloads(time_t now)
int
router_have_minimum_dir_info(void)
{
- int tot = 0, any_running = 0;
+ int tot = 0, num_running = 0;
int n_ns, res, avg;
static int have_enough = 0;
if (!networkstatus_list || !routerlist) {
@@ -3504,12 +3504,10 @@ router_have_minimum_dir_info(void)
avg = tot / n_ns;
SMARTLIST_FOREACH(routerstatus_list, local_routerstatus_t *, rs,
{
- if (rs->status.is_running) {
- any_running = 1;
- break;
- }
+ if (rs->status.is_running)
+ num_running++;
});
- res = smartlist_len(routerlist->routers) > (avg/4) && any_running;
+ res = smartlist_len(routerlist->routers) >= (avg/4) && num_running > 2;
done:
if (res && !have_enough) {
log(LOG_NOTICE, LD_DIR,