fix(daemon): guard start/connect during shutdown

Once a shutdown was under way the app could still launch or restart the
full node and keep running the RPC connection state machine. That could
spawn a daemon process on the way out and surface a spurious connection
failure toast as the window tore down.

- Starting the embedded daemon now bails out immediately while a
  shutdown is in progress, so the node is never (re)launched on exit.
- The connect attempt returns early during shutdown, so there is no
  start/connect try and no stray failure toast on the exit screen.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-10-13 17:42:29 -05:00
co-authored by Claude Opus 4.8
parent bbe2bf94dc
commit 96352ce9ad
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -5769,6 +5769,7 @@ void App::setDaemonStatus(std::string s)
bool App::startEmbeddedDaemon()
{
if (shutting_down_) return false; // exit in progress: never (re)launch the node
if (!supportsEmbeddedDaemon()) {
DEBUG_LOGF("Embedded daemon support unavailable in this build, not starting\n");
return false;
+1
View File
@@ -393,6 +393,7 @@ void App::tryConnect()
// Lite builds have no full node / RPC daemon, so never run the RPC connection state machine
// (it would just fail every tick). The lite controller drives the wallet; "online" status is
// derived from it each frame in App::update(), which also gates the wallet UI (isConnected()).
if (shutting_down_) return; // exit screen: no connect/start attempt, no spurious failure toast
if (isLiteBuild()) return;
// Catch a startup wallet salvage as soon as it appears in the node's output — independent of whether