aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_utilities
diff options
context:
space:
mode:
authorjeffro256 <jeffro256@tutanota.com>2024-01-17 17:17:16 -0600
committerjeffro256 <jeffro256@tutanota.com>2025-03-10 01:32:08 -0500
commit008ba966da88f073f226b299533faca905ceabf8 (patch)
tree1be6c2f8d45b74ad0427e0117c67371c93974f7e /src/blockchain_utilities
parentd0118f4778db7e75d7ad2036076e5688cd6f3810 (diff)
downloadmonzero-core-008ba966da88f073f226b299533faca905ceabf8.tar.gz
monzero-core-008ba966da88f073f226b299533faca905ceabf8.tar.xz
monzero-core-008ba966da88f073f226b299533faca905ceabf8.zip
blockchain sync: reduce disk writes from 2 to 1 per tx
Diffstat (limited to 'src/blockchain_utilities')
-rw-r--r--src/blockchain_utilities/blockchain_import.cpp7
1 files changed, 5 insertions, 2 deletions
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_complete_entry> &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_complete_entry> &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)
{