From bfe4de8ea383c61008648a783f0c1ea87b0f8e05 Mon Sep 17 00:00:00 2001 From: selsta Date: Mon, 21 Sep 2026 00:43:20 +0200 Subject: [PATCH] cryptonote_core: reject duplicate tx hashes before pool lookup (cherry picked from commit 03f957c18c8818c3c25b75d771fe48c37036b6e3) --- src/cryptonote_core/cryptonote_core.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp index 2074639ae..607754216 100644 --- a/src/cryptonote_core/cryptonote_core.cpp +++ b/src/cryptonote_core/cryptonote_core.cpp @@ -1268,6 +1268,9 @@ namespace cryptonote //----------------------------------------------------------------------------------------------- block_complete_entry get_block_complete_entry(block& b, tx_memory_pool &pool) { + const std::unordered_set tx_hashes(b.tx_hashes.cbegin(), b.tx_hashes.cend()); + CHECK_AND_ASSERT_THROW_MES(tx_hashes.size() == b.tx_hashes.size(), "Duplicate transaction hashes in block"); + block_complete_entry bce; bce.block = cryptonote::block_to_blob(b); bce.block_weight = 0; // we can leave it to 0, those txes aren't pruned