[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [sbws/master] scanner: use consensus_bandwidth when sorting relays



commit ca463e5e3432b13fb6f3c781fb8d96a9b45ee7be
Author: juga0 <juga@xxxxxxxxxx>
Date:   Wed Dec 19 18:10:49 2018 +0000

    scanner: use consensus_bandwidth when sorting relays
    
    instead of bandwidth.
    Forgotten when bandwidth was renamed to consensus_bandwidth in
    9e089b72d8abfb2b2a6c2ec9a66cb01d115205a6.
---
 sbws/core/scanner.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sbws/core/scanner.py b/sbws/core/scanner.py
index 80251ec..39dddba 100644
--- a/sbws/core/scanner.py
+++ b/sbws/core/scanner.py
@@ -154,7 +154,8 @@ def _pick_ideal_second_hop(relay, dest, rl, cont, is_exit):
                 len(new_candidates), min_bw_factor, relay.nickname,
                 chosen.nickname, chosen.consensus_bandwidth)
             return chosen
-    candidates = sorted(candidates, key=lambda r: r.bandwidth, reverse=True)
+    candidates = sorted(candidates, key=lambda r: r.consensus_bandwidth,
+                        reverse=True)
     chosen = candidates[0]
     log.debug(
         'Didn\'t find any 2nd hops at least as fast as %s (bw=%s). It\'s '



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits