From 7aa4d90c602e0bac5f94abc0ff859d7190ecedbd Mon Sep 17 00:00:00 2001
From: Petr Svenda <petr@svenda.com>
Date: Sun, 6 Oct 2024 07:09:41 +0200
Subject: [PATCH] fix incomplete detection of false positives in
 wasabi_detect_false - now process all transactions from root folder, not only
 per-month ones (was causing more txs without input or output connections to
 other cjtxs)

---
 Scripts/parse_dumplings.py | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/Scripts/parse_dumplings.py b/Scripts/parse_dumplings.py
index 19e04ad..fbee436 100644
--- a/Scripts/parse_dumplings.py
+++ b/Scripts/parse_dumplings.py
@@ -2004,9 +2004,17 @@ def wasabi_plot_remixes(mix_id: str, mix_protocol: MIX_PROTOCOL, target_path: Pa
 
 
 def wasabi_detect_false(target_path: Path, tx_file: str):
-    files = os.listdir(target_path) if os.path.exists(target_path) else print(
-        f'Path {target_path} does not exist')
+    PROCESS_SUBFOLDERS = False
+    if PROCESS_SUBFOLDERS:
+        # Process all subfolders
+        files = os.listdir(target_path) if os.path.exists(target_path) else print(
+            f'Path {target_path} does not exist')
+    else:
+        # Process only single root directory
+        files = [""] if os.path.exists(target_path) else print(
+            f'Path {target_path} does not exist')
 
+    print(f'Going to process the following subfolders of {target_path}: {files}')
     # Load false positives
     fp_file = os.path.join(target_path, 'false_cjtxs.json')
     false_cjtxs = als.load_json_from_file(fp_file)
-- 
GitLab