aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/blockchain.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-11-23 11:15:04 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-03-05 11:58:13 +0000
commit238401d4e950dad6a243fb895027dd26d2992ee6 (patch)
treeace8c69b75f6e6db2d2bdad69456ce346348b48c /src/cryptonote_core/blockchain.cpp
parentblockchain: avoid unneeded block copy (diff)
downloadmonero-238401d4e950dad6a243fb895027dd26d2992ee6.tar.xz
core: avoid double parsing blocks after hoh
Diffstat (limited to 'src/cryptonote_core/blockchain.cpp')
-rw-r--r--src/cryptonote_core/blockchain.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp
index a1bee09dc..2890af628 100644
--- a/src/cryptonote_core/blockchain.cpp
+++ b/src/cryptonote_core/blockchain.cpp
@@ -4211,13 +4211,14 @@ uint64_t Blockchain::prevalidate_block_hashes(uint64_t height, const std::vector
// vs [k_image, output_keys] (m_scan_table). This is faster because it takes advantage of bulk queries
// and is threaded if possible. The table (m_scan_table) will be used later when querying output
// keys.
-bool Blockchain::prepare_handle_incoming_blocks(const std::vector<block_complete_entry> &blocks_entry)
+bool Blockchain::prepare_handle_incoming_blocks(const std::vector<block_complete_entry> &blocks_entry, std::vector<block> &blocks)
{
MTRACE("Blockchain::" << __func__);
TIME_MEASURE_START(prepare);
bool stop_batch;
uint64_t bytes = 0;
size_t total_txs = 0;
+ blocks.clear();
// Order of locking must be:
// m_incoming_tx_lock (optional)
@@ -4264,7 +4265,6 @@ bool Blockchain::prepare_handle_incoming_blocks(const std::vector<block_complete
bool blocks_exist = false;
tools::threadpool& tpool = tools::threadpool::getInstance();
unsigned threads = tpool.get_max_concurrency();
- std::vector<block> blocks;
blocks.resize(blocks_entry.size());
if (1)