Skip to content
Snippets Groups Projects
Commit d4156761 authored by Petr Svenda's avatar Petr Svenda
Browse files

add dedicated method performing loading and filtering of false positives from coinjoins

parent 76094aaa
No related branches found
No related tags found
No related merge requests found
......@@ -937,3 +937,18 @@ def sort_coinjoins(cjtxs: dict, sort_by_order: bool = False):
for cjtxid in cjtxs.keys()]
sorted_cj_time = sorted(cj_time, key=lambda x: x['broadcast_time'])
return sorted_cj_time
def load_coinjoins_from_file(target_load_path: str, filter_false_positives: bool) -> dict:
logging.info(f'Loading {target_load_path}/coinjoin_tx_info.json ...')
data = load_json_from_file(os.path.join(target_load_path, f'coinjoin_tx_info.json'))
# Filter false positives if required
if filter_false_positives:
fp_file = os.path.join(target_load_path, 'false_cjtxs.json')
false_cjtxs = load_json_from_file(fp_file)
for false_tx in false_cjtxs:
if false_tx in data['coinjoins'].keys():
data['coinjoins'].pop(false_tx)
return data
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment