mirror of
https://github.com/monero-project/monero.git
synced 2025-12-22 07:10:46 -08:00
core: avoid double parsing blocks after hoh
This commit is contained in:
@@ -193,8 +193,16 @@ int check_flush(cryptonote::core &core, std::vector<block_complete_entry> &block
|
||||
}
|
||||
core.prevalidate_block_hashes(core.get_blockchain_storage().get_db().height(), hashes);
|
||||
|
||||
core.prepare_handle_incoming_blocks(blocks);
|
||||
std::vector<block> pblocks;
|
||||
core.prepare_handle_incoming_blocks(blocks, pblocks);
|
||||
if (!pblocks.empty() && pblocks.size() != blocks.size())
|
||||
{
|
||||
MERROR("Unexpected parsed blocks size");
|
||||
core.cleanup_handle_incoming_blocks();
|
||||
return 1;
|
||||
}
|
||||
|
||||
size_t blockidx = 0;
|
||||
for(const block_complete_entry& block_entry: blocks)
|
||||
{
|
||||
// process transactions
|
||||
@@ -215,7 +223,7 @@ int check_flush(cryptonote::core &core, std::vector<block_complete_entry> &block
|
||||
|
||||
block_verification_context bvc = boost::value_initialized<block_verification_context>();
|
||||
|
||||
core.handle_incoming_block(block_entry.block, bvc, false); // <--- process block
|
||||
core.handle_incoming_block(block_entry.block, pblocks.empty() ? NULL : &pblocks[blockidx++], bvc, false); // <--- process block
|
||||
|
||||
if(bvc.m_verifivation_failed)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user