Merge pull request #2707

3067da20 core: guard against a mined block not finding all txes in the pool (moneromooo-monero)
This commit is contained in:
Riccardo Spagni 2017-10-23 11:15:51 +02:00
commit f97dfc4ee9
No known key found for this signature in database
GPG key ID: 55432DF31CCD4FCD

View file

@ -1026,7 +1026,15 @@ namespace cryptonote
block_verification_context bvc = boost::value_initialized<block_verification_context>();
m_miner.pause();
std::list<block_complete_entry> blocks;
blocks.push_back(get_block_complete_entry(b, m_mempool));
try
{
blocks.push_back(get_block_complete_entry(b, m_mempool));
}
catch (const std::exception &e)
{
m_miner.resume();
return false;
}
prepare_handle_incoming_blocks(blocks);
m_blockchain_storage.add_new_block(b, bvc);
cleanup_handle_incoming_blocks(true);