aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/cryptonote_core.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/cryptonote_core/cryptonote_core.cpp')
-rw-r--r--src/cryptonote_core/cryptonote_core.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp
index bab0e2dd9..6639db620 100644
--- a/src/cryptonote_core/cryptonote_core.cpp
+++ b/src/cryptonote_core/cryptonote_core.cpp
@@ -1331,7 +1331,12 @@ namespace cryptonote
return false;
}
std::vector<block> pblocks;
- prepare_handle_incoming_blocks(blocks, pblocks);
+ if (!prepare_handle_incoming_blocks(blocks, pblocks))
+ {
+ MERROR("Block found, but failed to prepare to add");
+ m_miner.resume();
+ return false;
+ }
m_blockchain_storage.add_new_block(b, bvc);
cleanup_handle_incoming_blocks(true);
//anyway - update miner template
@@ -1385,7 +1390,11 @@ namespace cryptonote
bool core::prepare_handle_incoming_blocks(const std::vector<block_complete_entry> &blocks_entry, std::vector<block> &blocks)
{
m_incoming_tx_lock.lock();
- m_blockchain_storage.prepare_handle_incoming_blocks(blocks_entry, blocks);
+ if (!m_blockchain_storage.prepare_handle_incoming_blocks(blocks_entry, blocks))
+ {
+ cleanup_handle_incoming_blocks(false);
+ return false;
+ }
return true;
}