aboutsummaryrefslogtreecommitdiff
path: root/src/bitcoind.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/bitcoind.cpp')
-rw-r--r--src/bitcoind.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp
index aefb130e9c..8982d0a316 100644
--- a/src/bitcoind.cpp
+++ b/src/bitcoind.cpp
@@ -169,7 +169,7 @@ static bool AppInit(NodeContext& node, int argc, char* argv[])
// Set this early so that parameter interactions go to console
InitLogging(args);
InitParameterInteraction(args);
- if (!AppInitBasicSetup(args)) {
+ if (!AppInitBasicSetup(args, node.exit_status)) {
// InitError will have been called with detailed error, which ends up on console
return false;
}
@@ -238,6 +238,8 @@ static bool AppInit(NodeContext& node, int argc, char* argv[])
SetSyscallSandboxPolicy(SyscallSandboxPolicy::SHUTOFF);
if (fRet) {
WaitForShutdown();
+ } else {
+ node.exit_status = EXIT_FAILURE;
}
Interrupt(node);
Shutdown(node);
@@ -264,5 +266,5 @@ MAIN_FUNCTION
// Connect bitcoind signal handlers
noui_connect();
- return (AppInit(node, argc, argv) ? EXIT_SUCCESS : EXIT_FAILURE);
+ return AppInit(node, argc, argv) ? node.exit_status.load() : EXIT_FAILURE;
}