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

[tor-commits] [chutney/master] TorNet: correct getOnionService logic



commit f0055aa5baae865072ae9e06c8b92460c0ad43f3
Author: c <c@xxxxxxxxxxx>
Date:   Sun May 17 04:33:28 2020 +0000

    TorNet: correct getOnionService logic
    
    Pretty sure I messed up the logic for this function; in any case let's
    be safe and write it more clearly
---
 lib/chutney/TorNet.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/chutney/TorNet.py b/lib/chutney/TorNet.py
index 7d69eed..953d7f5 100644
--- a/lib/chutney/TorNet.py
+++ b/lib/chutney/TorNet.py
@@ -1222,10 +1222,12 @@ class LocalNodeController(NodeController):
            bootstrapped."""
         pct, _, _ = self.getLastBootstrapStatus()
         if self.getOnionService():
-            return pct == LocalNodeController.SUCCESS_CODE
-        else:
+        if pct != LocalNodeController.SUCCESS_CODE:
+            return False
             pct, _, _ = self.getLastOnionServiceDescStatus()
-            return pct == LocalNodeController.ONIONDESC_PUBLISHED_CODE
+            if pct != LocalNodeController.ONIONDESC_PUBLISHED_CODE:
+                return False
+        return True
 
     # There are 7 v3 directory document types, but some networks only use 6,
     # because they don't have a bridge authority



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