[tor-commits] [chutney/master] TorNet: Recalculate elapsed time as needed

teor at torproject.org teor at torproject.org
Mon Mar 16 08:18:43 UTC 2020


commit d0ac1c6f1a5346dd6aecca053fba1920632ef4dd
Author: teor <teor at torproject.org>
Date:   Mon Mar 16 15:50:14 2020 +1000

    TorNet: Recalculate elapsed time as needed
    
    chutney was calculating some elapsed times incorrectly, leading to longer
    wait times for network bootstrap.
    
    Bugfix on 33615.
---
 lib/chutney/TorNet.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/chutney/TorNet.py b/lib/chutney/TorNet.py
index 73e21f4..9857968 100644
--- a/lib/chutney/TorNet.py
+++ b/lib/chutney/TorNet.py
@@ -2264,6 +2264,7 @@ class Network(object):
                 print("Waiting {} seconds for other dir info to sync...\n"
                       .format(int(wait_time)))
                 time.sleep(wait_time)
+                now = time.time()
                 elapsed = now - start
 
                 # Wait for a minimum amount of run time, to avoid a race
@@ -2283,6 +2284,7 @@ class Network(object):
                     print(("Waiting another {} seconds for legacy tor "
                            "microdesc downloads...\n").format(int(sleep_time)))
                     time.sleep(sleep_time)
+                    now = time.time()
                     elapsed = now - start
                 return True
             if now >= limit:





More information about the tor-commits mailing list