From b527c59735addfd38afee40853fcc549d66853c0 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Thu, 7 May 2026 15:50:07 +0200 Subject: [PATCH] Cleanup --- RNS/Utilities/rnid.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/RNS/Utilities/rnid.py b/RNS/Utilities/rnid.py index 2eb061f9..bd2e296c 100644 --- a/RNS/Utilities/rnid.py +++ b/RNS/Utilities/rnid.py @@ -196,8 +196,8 @@ def get_operating_identity(args): try: load_path = os.path.expanduser(args.identity) except: pass + # Attempt to load Identity from .rid file if load_path and os.path.isfile(load_path): - # Attempt to load Identity from .rid file try: identity = RNS.Identity.from_file(load_path) print(f"Loaded Identity {identity} from {load_path}") @@ -208,10 +208,11 @@ def get_operating_identity(args): print(f"Could not load Identity from specified file: {e}") exit(9) - elif len(identity_str) == RNS.Reticulum.TRUNCATED_HASHLENGTH//8*2: - # Attempt to recall Identity from hex-encoded hash + # Attempt to recall Identity from hex-encoded hash + elif len(args.identity) == RNS.Reticulum.TRUNCATED_HASHLENGTH//8*2: try: - ident_hash = bytes.fromhex(identity_str) + ensure_reticulum(args) + ident_hash = bytes.fromhex(args.identity) identity = RNS.Identity.recall(ident_hash) or RNS.Identity.recall(ident_hash, from_identity_hash=True) if identity == None: @@ -221,7 +222,6 @@ def get_operating_identity(args): exit(5) else: - ensure_reticulum(args) RNS.Transport.request_path(ident_hash) def spincheck(): return RNS.Identity.recall(ident_hash) != None spin(spincheck, "Requesting unknown Identity for "+RNS.prettyhexrep(ident_hash), args.t)