aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-10-15 18:58:57 +0200
committerRiccardo Spagni <ric@spagni.net>2017-10-15 18:58:57 +0200
commit344c01c71235d43e156da26053020a3696393ea5 (patch)
treec09dfd3461d2a5a3c41b9d13b70dcf1212ce3c2f /src/cryptonote_core
parentMerge pull request #2613 (diff)
parentcore: guard against a mined block not finding all txes in the pool (diff)
downloadmonero-344c01c71235d43e156da26053020a3696393ea5.tar.xz
Merge pull request #2638
529a6a4a core: guard against a mined block not finding all txes in the pool (moneromooo-monero)
Diffstat (limited to 'src/cryptonote_core')
-rw-r--r--src/cryptonote_core/cryptonote_core.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp
index cec3f7225..61f844612 100644
--- a/src/cryptonote_core/cryptonote_core.cpp
+++ b/src/cryptonote_core/cryptonote_core.cpp
@@ -1029,7 +1029,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);