aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_utilities
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-08-29 15:43:32 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-08-29 15:43:32 +0100
commitce901fcb3174a2795483fba653a1128ce6b15858 (patch)
treeb8955b4e258d3e62799b820dd0b4e6cc6d4b9caf /src/blockchain_utilities
parentcore: guard against exceptions in handle_incoming_{block,tx} (diff)
downloadmonero-ce901fcb3174a2795483fba653a1128ce6b15858.tar.xz
Fix blockchain_import wedge on exception in cleanup_handle_incoming_blocks
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 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<block_complete_entry> &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
{