diff options
| author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-10-11 13:00:49 +0100 |
|---|---|---|
| committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-10-11 13:00:49 +0100 |
| commit | 529a6a4af8b5b15e4c5a53ea62d7c8dd5a656a01 (patch) | |
| tree | 0f5dfeaf9fca15521ef54b34c3c31cbd4c400f0a | |
| parent | 86e9de588c2b550ff5a005d0fcc8445fd5f58baa (diff) | |
| download | monzero-core-529a6a4af8b5b15e4c5a53ea62d7c8dd5a656a01.tar.gz monzero-core-529a6a4af8b5b15e4c5a53ea62d7c8dd5a656a01.tar.xz monzero-core-529a6a4af8b5b15e4c5a53ea62d7c8dd5a656a01.zip | |
core: guard against a mined block not finding all txes in the pool
This can happen for several reasons, but mainly if another block
was received, which took that tx off the pool.
| -rw-r--r-- | src/cryptonote_core/cryptonote_core.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp index c1a5ae324..d0196c2ae 100644 --- a/src/cryptonote_core/cryptonote_core.cpp +++ b/src/cryptonote_core/cryptonote_core.cpp @@ -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); |
