From 008ba966da88f073f226b299533faca905ceabf8 Mon Sep 17 00:00:00 2001 From: jeffro256 Date: Wed, 17 Jan 2024 17:17:16 -0600 Subject: blockchain sync: reduce disk writes from 2 to 1 per tx --- src/blockchain_utilities/blockchain_import.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/blockchain_utilities/blockchain_import.cpp') diff --git a/src/blockchain_utilities/blockchain_import.cpp b/src/blockchain_utilities/blockchain_import.cpp index f8cca638d..8a25e1da9 100644 --- a/src/blockchain_utilities/blockchain_import.cpp +++ b/src/blockchain_utilities/blockchain_import.cpp @@ -174,7 +174,9 @@ int check_flush(cryptonote::core &core, std::vector &block for(auto& tx_blob: block_entry.txs) { tx_verification_context tvc = AUTO_VAL_INIT(tvc); - core.handle_incoming_tx(tx_blob, tvc, relay_method::block, true); + CHECK_AND_ASSERT_THROW_MES(tx_blob.prunable_hash == crypto::null_hash, + "block entry must not contain pruned txs"); + core.handle_incoming_tx(tx_blob.blob, tvc, relay_method::block, true); if(tvc.m_verifivation_failed) { cryptonote::transaction transaction; @@ -190,8 +192,9 @@ int check_flush(cryptonote::core &core, std::vector &block // process block block_verification_context bvc = {}; + pool_supplement ps{}; - core.handle_incoming_block(block_entry.block, pblocks.empty() ? NULL : &pblocks[blockidx++], bvc, false); // <--- process block + core.handle_incoming_block(block_entry.block, pblocks.empty() ? NULL : &pblocks[blockidx++], bvc, ps, false); // <--- process block if(bvc.m_verifivation_failed) { -- cgit v1.2.3