move ThreadImport ABC error to use AbortNode

'StartShutdown' should only be used for user requested
shutdowns. Internal errors that cause a shutdown should
use 'AbortNode'.
This commit is contained in:
furszy 2023-05-29 18:56:58 -03:00
parent a36134fcc7
commit 9ddf7e03a3
No known key found for this signature in database
GPG key ID: 5DD23CCC686AA623

View file

@ -928,8 +928,7 @@ void ThreadImport(ChainstateManager& chainman, std::vector<fs::path> vImportFile
for (Chainstate* chainstate : WITH_LOCK(::cs_main, return chainman.GetAll())) {
BlockValidationState state;
if (!chainstate->ActivateBestChain(state, nullptr)) {
LogPrintf("Failed to connect best block (%s)\n", state.ToString());
StartShutdown();
AbortNode(strprintf("Failed to connect best block (%s)", state.ToString()));
return;
}
}