From 5470f752b4dcde4860be6cc15eba009e99164ec5 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Sun, 20 Oct 2024 12:26:54 +0200 Subject: [PATCH] Cleanup --- RNS/Identity.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/RNS/Identity.py b/RNS/Identity.py index f1c6bdb..1232486 100644 --- a/RNS/Identity.py +++ b/RNS/Identity.py @@ -331,10 +331,10 @@ class Identity: try: with open(ratchet_path, "rb") as ratchet_file: ratchet_data = umsgpack.unpackb(ratchet_file.read()) - if time.time() < ratchet_data["received"]+Identity.RATCHET_EXPIRY and len(ratchet_data["ratchet"]) == Identity.RATCHETSIZE//8: - Identity.known_ratchets[destination_hash] = ratchet_data["ratchet"] - else: - return None + if time.time() < ratchet_data["received"]+Identity.RATCHET_EXPIRY and len(ratchet_data["ratchet"]) == Identity.RATCHETSIZE//8: + Identity.known_ratchets[destination_hash] = ratchet_data["ratchet"] + else: + return None except Exception as e: RNS.log(f"An error occurred while loading ratchet data for {RNS.prettyhexrep(destination_hash)} from storage.", RNS.LOG_ERROR)