cryptonote_core: reject duplicate tx hashes before pool lookup

(cherry picked from commit 03f957c18c8818c3c25b75d771fe48c37036b6e3)
This commit is contained in:
selsta
2026-10-04 18:50:24 -04:00
committed by such-gitea
parent 7f028f56cd
commit bfe4de8ea3
+3
View File
@@ -1268,6 +1268,9 @@ namespace cryptonote
//-----------------------------------------------------------------------------------------------
block_complete_entry get_block_complete_entry(block& b, tx_memory_pool &pool)
{
const std::unordered_set<crypto::hash> 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