aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core
diff options
context:
space:
mode:
authorAlexander Blair <snipa@jagtech.io>2020-01-25 16:55:18 -0800
committerAlexander Blair <snipa@jagtech.io>2020-01-25 16:55:18 -0800
commit8eedc8a390c73112af9fff712a47c2c1814bc16a (patch)
treeab8cf897aaeb94c7ad18fd7e8336009c354640d4 /src/cryptonote_core
parentMerge pull request #6170 (diff)
parentblockchain: speedup fetching pruned contiguous tx blobs (diff)
downloadmonero-8eedc8a390c73112af9fff712a47c2c1814bc16a.tar.xz
Merge pull request #6140
08635a08 blockchain: speedup fetching pruned contiguous tx blobs (moneromooo-monero)
Diffstat (limited to 'src/cryptonote_core')
-rw-r--r--src/cryptonote_core/blockchain.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp
index 5070cc169..f99073719 100644
--- a/src/cryptonote_core/blockchain.cpp
+++ b/src/cryptonote_core/blockchain.cpp
@@ -2498,10 +2498,17 @@ bool Blockchain::find_blockchain_supplement(const uint64_t req_start_block, cons
block b;
CHECK_AND_ASSERT_MES(parse_and_validate_block_from_blob(blocks.back().first.first, b), false, "internal error, invalid block");
blocks.back().first.second = get_miner_tx_hash ? cryptonote::get_transaction_hash(b.miner_tx) : crypto::null_hash;
- std::vector<crypto::hash> mis;
std::vector<cryptonote::blobdata> txs;
- get_transactions_blobs(b.tx_hashes, txs, mis, pruned);
- CHECK_AND_ASSERT_MES(!mis.size(), false, "internal error, transaction from block not found");
+ if (pruned)
+ {
+ CHECK_AND_ASSERT_MES(m_db->get_pruned_tx_blobs_from(b.tx_hashes.front(), b.tx_hashes.size(), txs), false, "Failed to retrieve all transactions needed");
+ }
+ else
+ {
+ std::vector<crypto::hash> mis;
+ get_transactions_blobs(b.tx_hashes, txs, mis, pruned);
+ CHECK_AND_ASSERT_MES(!mis.size(), false, "internal error, transaction from block not found");
+ }
size += blocks.back().first.first.size();
for (const auto &t: txs)
size += t.size();