From 17e8159fd859b5a41ab26c80d53608adb94e4949 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Thu, 23 Apr 2026 01:16:43 +0200 Subject: [PATCH] Improved ratchet cleaning --- RNS/Identity.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/RNS/Identity.py b/RNS/Identity.py index cee77f9..1235e99 100644 --- a/RNS/Identity.py +++ b/RNS/Identity.py @@ -455,7 +455,7 @@ class Identity: if not destination_hash in RNS.Identity.known_destinations: unknown = True; not_known += 1 else: unknown = False - if expired or corrupted: + if expired or corrupted or unknown: os.unlink(f"{ratchetdir}/{filename}") removed += 1 @@ -464,6 +464,7 @@ class Identity: RNS.log(f"The contained exception was: {e}", RNS.LOG_ERROR) except Exception as e: RNS.log(f"An error occurred while cleaning ratchets. The contained exception was: {e}", RNS.LOG_ERROR) + RNS.log(f"Processed {count} ratchets in {RNS.prettytime(time.time()-now)}, not in use {not_known}, removed {removed}", RNS.LOG_DEBUG) @staticmethod def get_ratchet(destination_hash):