summaryrefslogtreecommitdiff
path: root/src/or/routerlist.c
diff options
context:
space:
mode:
authorteor <teor2345@gmail.com>2015-01-10 17:20:06 +1100
committerteor <teor2345@gmail.com>2015-01-10 17:20:06 +1100
commitf8ffb57bc4430ff9bbd7560eecdda4284b2799ba (patch)
tree7b73b0bf39d756c31bb62dbcd3c239864a6a46c8 /src/or/routerlist.c
parentdebd7862bb6d641c13fe4ee019da633c683d740e (diff)
parent33df3e37ffecfed309a1a0f210a96620c0ebb837 (diff)
downloadtor-f8ffb57bc4430ff9bbd7560eecdda4284b2799ba.tar.gz
tor-f8ffb57bc4430ff9bbd7560eecdda4284b2799ba.zip
Merge branch 'master' of https://git.torproject.org/tor into bug13111-empty-key-files-fn-empty
Conflicts: src/or/connection_edge.c Merged in favour of origin.
Diffstat (limited to 'src/or/routerlist.c')
-rw-r--r--src/or/routerlist.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index c9d2f8ad28..d3734238eb 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -1,7 +1,7 @@
/* Copyright (c) 2001 Matej Pfajfar.
* Copyright (c) 2001-2004, Roger Dingledine.
* Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
- * Copyright (c) 2007-2014, The Tor Project, Inc. */
+ * Copyright (c) 2007-2015, The Tor Project, Inc. */
/* See LICENSE for licensing information */
/**
@@ -2211,11 +2211,29 @@ router_choose_random_node(smartlist_t *excludedsmartlist,
router_add_running_nodes_to_smartlist(sl, allow_invalid,
need_uptime, need_capacity,
need_guard, need_desc);
+ log_debug(LD_CIRC,
+ "We found %d running nodes.",
+ smartlist_len(sl));
+
smartlist_subtract(sl,excludednodes);
- if (excludedsmartlist)
+ log_debug(LD_CIRC,
+ "We removed %d excludednodes, leaving %d nodes.",
+ smartlist_len(excludednodes),
+ smartlist_len(sl));
+
+ if (excludedsmartlist) {
smartlist_subtract(sl,excludedsmartlist);
- if (excludedset)
+ log_debug(LD_CIRC,
+ "We removed %d excludedsmartlist, leaving %d nodes.",
+ smartlist_len(excludedsmartlist),
+ smartlist_len(sl));
+ }
+ if (excludedset) {
routerset_subtract_nodes(sl,excludedset);
+ log_debug(LD_CIRC,
+ "We removed excludedset, leaving %d nodes.",
+ smartlist_len(sl));
+ }
// Always weight by bandwidth
choice = node_sl_choose_by_bandwidth(sl, rule);