From 556b3ac772cd9d51c5ac35cf7fca025c6420762a Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Tue, 24 Sep 2024 14:22:00 +0100 Subject: [PATCH] Simplify double spend validation in validate_block_body. --- chia/consensus/block_body_validation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chia/consensus/block_body_validation.py b/chia/consensus/block_body_validation.py index c7f4081dff6b..bb42e87434db 100644 --- a/chia/consensus/block_body_validation.py +++ b/chia/consensus/block_body_validation.py @@ -367,8 +367,8 @@ async def validate_block_body( # 14. Check for duplicate spends inside block removal_counter = collections.Counter(removals) - for k, v in removal_counter.items(): - if v > 1: + for count in removal_counter.values(): + if count > 1: return Err.DOUBLE_SPEND, None # 15. Check if removals exist and were not previously spent. (unspent_db + diff_store + this_block)