diff options
| author | j-berman <justinberman@protonmail.com> | 2025-10-09 11:25:10 -0700 |
|---|---|---|
| committer | j-berman <justinberman@protonmail.com> | 2025-11-11 16:45:06 -0800 |
| commit | 4e4e3439c9ce5c2adc297fe8b66e69ef0848438c (patch) | |
| tree | 563db4c0076a878620cdfc609837b6bbb20d496c /src/cryptonote_core/cryptonote_core.cpp | |
| parent | 6f2574d9d2a38a637aff47a59968edec8485c732 (diff) | |
| download | monzero-core-4e4e3439c9ce5c2adc297fe8b66e69ef0848438c.tar.gz monzero-core-4e4e3439c9ce5c2adc297fe8b66e69ef0848438c.tar.xz monzero-core-4e4e3439c9ce5c2adc297fe8b66e69ef0848438c.zip | |
Daemon: relay empty fluffy block on found block
Diffstat (limited to 'src/cryptonote_core/cryptonote_core.cpp')
| -rw-r--r-- | src/cryptonote_core/cryptonote_core.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp index 2df72a419..300fb2553 100644 --- a/src/cryptonote_core/cryptonote_core.cpp +++ b/src/cryptonote_core/cryptonote_core.cpp @@ -1302,20 +1302,23 @@ namespace cryptonote NOTIFY_NEW_FLUFFY_BLOCK::request arg{}; arg.current_blockchain_height = m_blockchain_storage.get_current_blockchain_height(); std::vector<crypto::hash> missed_txs; - std::vector<cryptonote::blobdata> txs; - m_blockchain_storage.get_transactions_blobs(b.tx_hashes, txs, 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(txs.size() == b.tx_hashes.size() && !missed_txs.size(), false, "can't find some transactions in found block:" << get_block_hash(b) << " txs.size()=" << txs.size() - << ", b.tx_hashes.size()=" << b.tx_hashes.size() << ", missed_txs.size()" << missed_txs.size()); + 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()); block_to_blob(b, arg.b.block); - //pack transactions - for(auto& tx: txs) - arg.b.txs.push_back({tx, crypto::null_hash}); + // Relay an empty fluffy block + arg.b.txs.clear(); m_pprotocol->relay_block(arg, exclude_context); } |
