aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_utilities
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-04-07 13:47:17 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-04-07 13:48:19 +0000
commitbea1918a05a565e62ae682706cf98e32507191ea (patch)
tree9fb672e3c955e392cb4e8eab0c98c5d941f4ef7a /src/blockchain_utilities
parentMerge pull request #5364 (diff)
downloadmonero-bea1918a05a565e62ae682706cf98e32507191ea.tar.xz
blockchain_import: error out if preparing to handle blocks fails
Coverity 197562
Diffstat (limited to 'src/blockchain_utilities')
-rw-r--r--src/blockchain_utilities/blockchain_import.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/blockchain_utilities/blockchain_import.cpp b/src/blockchain_utilities/blockchain_import.cpp
index 8454595ac..cb9154f29 100644
--- a/src/blockchain_utilities/blockchain_import.cpp
+++ b/src/blockchain_utilities/blockchain_import.cpp
@@ -194,7 +194,11 @@ int check_flush(cryptonote::core &core, std::vector<block_complete_entry> &block
core.prevalidate_block_hashes(core.get_blockchain_storage().get_db().height(), hashes);
std::vector<block> pblocks;
- core.prepare_handle_incoming_blocks(blocks, pblocks);
+ if (!core.prepare_handle_incoming_blocks(blocks, pblocks))
+ {
+ MERROR("Failed to prepare to add blocks");
+ return 1;
+ }
if (!pblocks.empty() && pblocks.size() != blocks.size())
{
MERROR("Unexpected parsed blocks size");