From 96352ce9ad5a1e98a8340f9ba16660cdd6a2e310 Mon Sep 17 00:00:00 2001 From: DanS Date: Tue, 13 Oct 2026 17:42:29 -0500 Subject: [PATCH] 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 --- src/app.cpp | 1 + src/app_network.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/app.cpp b/src/app.cpp index 8fbaf62..190ef42 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -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; diff --git a/src/app_network.cpp b/src/app_network.cpp index 9f23ca1..7e17a8b 100644 --- a/src/app_network.cpp +++ b/src/app_network.cpp @@ -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