From ce901fcb3174a2795483fba653a1128ce6b15858 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Tue, 29 Aug 2017 15:43:32 +0100 Subject: Fix blockchain_import wedge on exception in cleanup_handle_incoming_blocks --- src/blockchain_utilities/blockchain_import.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/blockchain_utilities') diff --git a/src/blockchain_utilities/blockchain_import.cpp b/src/blockchain_utilities/blockchain_import.cpp index ded854ca4..14f318768 100644 --- a/src/blockchain_utilities/blockchain_import.cpp +++ b/src/blockchain_utilities/blockchain_import.cpp @@ -208,7 +208,8 @@ int check_flush(cryptonote::core &core, std::list &blocks, } } // each download block - core.cleanup_handle_incoming_blocks(); + if (!core.cleanup_handle_incoming_blocks()) + return 1; blocks.clear(); return 0; @@ -394,7 +395,10 @@ int import_from_file(cryptonote::core& core, const std::string& import_file_path blocks.push_back({block, txs}); int ret = check_flush(core, blocks, false); if (ret) + { + quit = 2; // make sure we don't commit partial block data break; + } } else { -- cgit v1.2.3