diff options
author | luigi1111 <luigi1111w@gmail.com> | 2021-06-24 13:59:44 -0500 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2021-06-24 13:59:44 -0500 |
commit | 3366bd81eba74fcd4a30ec791ed5574516bdf8f1 (patch) | |
tree | 23dd77e022ebd534a58d113d3912bcaa08ed0673 /src/cryptonote_core/blockchain.cpp | |
parent | Merge pull request #7611 (diff) | |
parent | core: speed up print_coinbase_tx_sum (diff) | |
download | monero-3366bd81eba74fcd4a30ec791ed5574516bdf8f1.tar.xz |
Merge pull request #7612
254a133 core: speed up print_coinbase_tx_sum (moneromooo-monero)
Diffstat (limited to 'src/cryptonote_core/blockchain.cpp')
-rw-r--r-- | src/cryptonote_core/blockchain.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index db707bb65..2cd04d4cf 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -2612,7 +2612,7 @@ bool Blockchain::get_split_transactions_blobs(const t_ids_container& txs_ids, t_ } //------------------------------------------------------------------ template<class t_ids_container, class t_tx_container, class t_missed_container> -bool Blockchain::get_transactions(const t_ids_container& txs_ids, t_tx_container& txs, t_missed_container& missed_txs) const +bool Blockchain::get_transactions(const t_ids_container& txs_ids, t_tx_container& txs, t_missed_container& missed_txs, bool pruned) const { LOG_PRINT_L3("Blockchain::" << __func__); CRITICAL_REGION_LOCAL(m_blockchain_lock); @@ -2623,10 +2623,12 @@ bool Blockchain::get_transactions(const t_ids_container& txs_ids, t_tx_container try { cryptonote::blobdata tx; - if (m_db->get_tx_blob(tx_hash, tx)) + bool res = pruned ? m_db->get_pruned_tx_blob(tx_hash, tx) : m_db->get_tx_blob(tx_hash, tx); + if (res) { txs.push_back(transaction()); - if (!parse_and_validate_tx_from_blob(tx, txs.back())) + res = pruned ? parse_and_validate_tx_base_from_blob(tx, txs.back()) : parse_and_validate_tx_from_blob(tx, txs.back()); + if (!res) { LOG_ERROR("Invalid transaction"); return false; @@ -5530,6 +5532,6 @@ void Blockchain::cache_block_template(const block &b, const cryptonote::account_ } namespace cryptonote { -template bool Blockchain::get_transactions(const std::vector<crypto::hash>&, std::vector<transaction>&, std::vector<crypto::hash>&) const; +template bool Blockchain::get_transactions(const std::vector<crypto::hash>&, std::vector<transaction>&, std::vector<crypto::hash>&, bool) const; template bool Blockchain::get_split_transactions_blobs(const std::vector<crypto::hash>&, std::vector<std::tuple<crypto::hash, cryptonote::blobdata, crypto::hash, cryptonote::blobdata>>&, std::vector<crypto::hash>&) const; } |