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

[tor-commits] [metrics-tasks/master] Ignore a consensus without relays even sooner (#6232).



commit b8a3574dd5d5b96560d366b0082413484d7f05cc
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date:   Tue Jul 24 10:00:10 2012 +0200

    Ignore a consensus without relays even sooner (#6232).
---
 task-6232/pyentropy.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/task-6232/pyentropy.py b/task-6232/pyentropy.py
index 76a3d52..dd5e343 100644
--- a/task-6232/pyentropy.py
+++ b/task-6232/pyentropy.py
@@ -109,6 +109,9 @@ def run(file_name):
                 except:
                     pass
     
+    if len(routers) <= 0:
+        return
+    
     total_bw, total_exit_bw, total_guard_bw = 0, 0, 0
     guards_no, exits_no = 0, 0
     bw_countries, bw_as = {}, {}
@@ -135,9 +138,6 @@ def run(file_name):
             else:
                 bw_as[router.as_no] = router.bandwidth
     
-    if len(routers) <= 0:
-        return
-    
     entropy, entropy_exit, entropy_guard, entropy_country, entropy_as = 0.0, 0.0, 0.0, 0.0, 0.0
     for router in routers:
         p = float(router.bandwidth) / float(total_bw)



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