From b7e510246da1e0fb02bd9b68ba8cad4c6dfdc070 Mon Sep 17 00:00:00 2001 From: Zichao Lin Date: Mon, 28 Jul 2025 19:35:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BF=9D=E5=AD=98=E5=B7=B2?= =?UTF-8?q?=E5=A4=84=E7=90=86=E4=BA=A4=E6=98=93=E5=93=88=E5=B8=8C=E7=9A=84?= =?UTF-8?q?=E9=80=BB=E8=BE=91=EF=BC=8C=E5=90=88=E5=B9=B6=E6=96=B0=E5=93=88?= =?UTF-8?q?=E5=B8=8C=E5=B9=B6=E4=BF=9D=E6=8C=81=E5=8E=9F=E6=9C=89=E9=A1=BA?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 5757fc2..86965af 100644 --- a/main.py +++ b/main.py @@ -182,8 +182,9 @@ def save_processed_hashes(): except (FileNotFoundError, json.JSONDecodeError): existing_data = [] - # 合并新哈希 - updated_data = list(set(existing_data) | SEEN_TXHASHES) + # 合并新哈希并去重,保持原有顺序 + new_hashes = [h for h in SEEN_TXHASHES if h not in existing_data] + updated_data = existing_data + new_hashes # 写回文件 with open(HASH_FILE, "w", encoding="utf-8") as file: @@ -192,7 +193,7 @@ def save_processed_hashes(): LOGGER.info( "成功更新%s,新增%d条哈希,总计%d条记录", HASH_FILE, - len(SEEN_TXHASHES - set(existing_data)), + len(new_hashes), len(updated_data), ) except IOError as e: