From ce14fdc0eafaa75d76bc780445b3a19571f34c2d Mon Sep 17 00:00:00 2001 From: j-berman Date: Tue, 4 Aug 2026 14:01:43 -0700 Subject: [PATCH] cryptonote_core: rm unnecessary db reads before block relay --- src/cryptonote_core/cryptonote_core.cpp | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp index b08939f17..b0d4e9e66 100644 --- a/src/cryptonote_core/cryptonote_core.cpp +++ b/src/cryptonote_core/cryptonote_core.cpp @@ -1326,26 +1326,8 @@ namespace cryptonote { cryptonote_connection_context exclude_context = {}; NOTIFY_NEW_FLUFFY_BLOCK::request arg{}; - arg.current_blockchain_height = m_blockchain_storage.get_current_blockchain_height(); - std::vector missed_txs; - for (const auto &tx_hash : b.tx_hashes) - { - if (m_blockchain_storage.have_tx(tx_hash)) - continue; - missed_txs.push_back(tx_hash); - } - if(missed_txs.size() && m_blockchain_storage.get_block_id_by_height(get_block_height(b)) != get_block_hash(b)) - { - LOG_PRINT_L1("Block found but, seems that reorganize just happened after that, do not relay this block"); - return true; - } - CHECK_AND_ASSERT_MES(!missed_txs.size(), false, "can't find some transactions in found block:" << get_block_hash(b) - << " b.tx_hashes.size()=" << b.tx_hashes.size() << ", missed_txs.size()" << missed_txs.size()); - + arg.current_blockchain_height = get_block_height(b) + 1; block_to_blob(b, arg.b.block); - // Relay an empty fluffy block - arg.b.txs.clear(); - m_pprotocol->relay_block(arg, exclude_context); } return true;