mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 14:08:40 +01:00
Return EXIT_FAILURE on post-init fatal errors
It seems odd to return `EXIT_SUCCESS` when the node aborted execution due a fatal internal error or any post-init problem that triggers an unrequested shutdown. e.g. blocks or coins db I/O errors, disconnect block failure, failure during thread import (external blocks loading process error), among others. Co-authored-by: Ryan Ofsky <ryan@ofsky.org>
This commit is contained in:
@@ -800,7 +800,7 @@ std::set<BlockFilterType> g_enabled_filter_types;
|
||||
std::terminate();
|
||||
};
|
||||
|
||||
bool AppInitBasicSetup(const ArgsManager& args)
|
||||
bool AppInitBasicSetup(const ArgsManager& args, std::atomic<int>& exit_status)
|
||||
{
|
||||
// ********************************************************* Step 1: setup
|
||||
#ifdef _MSC_VER
|
||||
@@ -814,7 +814,7 @@ bool AppInitBasicSetup(const ArgsManager& args)
|
||||
// Enable heap terminate-on-corruption
|
||||
HeapSetInformation(nullptr, HeapEnableTerminationOnCorruption, nullptr, 0);
|
||||
#endif
|
||||
if (!InitShutdownState()) {
|
||||
if (!InitShutdownState(exit_status)) {
|
||||
return InitError(Untranslated("Initializing wait-for-shutdown state failed."));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user