commit a0367ccc66d4a47758f7e9fb9463b3a597a24777
Author: c <c...@chroniko.jp>
Date:   Thu Apr 9 13:17:18 2020 +0000

    TorNet: Check oniondesc status iff node has onion
    
    Modify isBootstrapped() only to check onion descriptor status for Tor
    nodes that declared onion services. This builds off last commit
    (2b3cee08) which erroneously checked *all* nodes for onion bootstrap
    status.
---
 lib/chutney/TorNet.py | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/lib/chutney/TorNet.py b/lib/chutney/TorNet.py
index 7838a78..b5eb186 100644
--- a/lib/chutney/TorNet.py
+++ b/lib/chutney/TorNet.py
@@ -1214,12 +1214,11 @@ class LocalNodeController(NodeController):
         """Return true iff the logfile says that this instance is
            bootstrapped."""
         pct, _, _ = self.getLastBootstrapStatus()
-        if pct != LocalNodeController.SUCCESS_CODE:
-            return False
-        pct, _, _ = self.getLastOnionServiceDescStatus()
-        if pct != LocalNodeController.ONIONDESC_PUBLISHED_CODE:
-            return False
-        return True
+        if self.getOnionService():
+            return pct == LocalNodeController.SUCCESS_CODE
+        else:
+            pct, _, _ = self.getLastOnionServiceDescStatus()
+            return pct == LocalNodeController.ONIONDESC_PUBLISHED_CODE
 
     # 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@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits

Reply via email to