init: Fix non-zero code on interrupt

An interrupt does not create a failure exit code during normal
operation. This should also be the case when interrupt is triggered
during initialization. However a failure exit code is currently returned
if an interrupt occurs during init. Fix this by making `AppInitMain` return
true instead of false, which further up the call stack sets the
`EXIT_FAILURE` code. Also add a check for the interrupt condition during
GUI startup.
This commit is contained in:
sedited
2026-01-07 20:51:28 +01:00
parent cd6e4c9235
commit 997e7b4d7c
2 changed files with 41 additions and 40 deletions

View File

@@ -1830,7 +1830,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
// requested to kill the GUI during the last operation. If so, exit.
if (ShutdownRequested(node)) {
LogInfo("Shutdown requested. Exiting.");
return false;
return true;
}
ChainstateManager& chainman = *Assert(node.chainman);
@@ -2006,7 +2006,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
}
if (ShutdownRequested(node)) {
return false;
return true;
}
// ********************************************************* Step 12: start node