From 93d13a65683ce00e9ff6df9f0b78dbdda718da25 Mon Sep 17 00:00:00 2001 From: jwinterm Date: Sat, 27 Jun 2026 13:10:54 -0400 Subject: [PATCH] v5.0.3: harden embedded-node restart handling + version bump On top of Lucas's #119 (--db-sync-mode safe): - DaemonManager: age out the crash-retry budget (m_restarts) so legit node toggles/restarts don't trip "maximum retries exceeded" after ~4 spawns over a session; the cap now only bites a genuine rapid crash-loop. - DaemonManager: clear the m_stopping latch on start(), so the crash auto-restart keeps working after the node has been toggled off then on (it was a one-shot before). - bump version 5.0.2 -> 5.0.3. --- CMakeLists.txt | 2 +- src/utils/DaemonManager.cpp | 14 ++++++++++++++ src/utils/DaemonManager.h | 1 + 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index decf65a8..6a3bb703 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.18) project(feather - VERSION "5.0.2" + VERSION "5.0.3" DESCRIPTION "A free Monero desktop wallet" LANGUAGES CXX C ASM ) diff --git a/src/utils/DaemonManager.cpp b/src/utils/DaemonManager.cpp index 7a5635c6..be729d96 100644 --- a/src/utils/DaemonManager.cpp +++ b/src/utils/DaemonManager.cpp @@ -4,6 +4,7 @@ #include "utils/DaemonManager.h" #include +#include #include #include #include @@ -62,6 +63,11 @@ void DaemonManager::start() { if (state == QProcess::ProcessState::Running || state == QProcess::ProcessState::Starting) return; + // wowlet: a deliberate (re)start clears the stop latch, so a later UNEXPECTED exit can auto-restart + // again. Without this, m_stopping stays true after the first node toggle-off and the crash + // auto-restart is silently dead for the rest of the session. + m_stopping = false; + if (!this->unpackBins()) { this->setErrorMessage("Unable to unpack the embedded wownerod binary."); return; @@ -85,6 +91,14 @@ void DaemonManager::start() { // and surfaces a clear error via handleProcessError(). } + // wowlet: the retry cap guards against a rapid crash-loop, not legit restarts. If the node had been + // up a while before this (re)start, clear the budget — otherwise a few node toggles over a session + // trip "maximum retries exceeded" and it won't start again until wowlet is relaunched. + const qint64 nowMs = QDateTime::currentMSecsSinceEpoch(); + if (m_lastSpawnMs != 0 && (nowMs - m_lastSpawnMs) > 60000) + m_restarts = 0; + m_lastSpawnMs = nowMs; + m_restarts += 1; if (m_restarts > 4) { this->setErrorMessage("wownerod failed to start: maximum retries exceeded"); diff --git a/src/utils/DaemonManager.h b/src/utils/DaemonManager.h index 18b3181d..8084cdae 100644 --- a/src/utils/DaemonManager.h +++ b/src/utils/DaemonManager.h @@ -73,6 +73,7 @@ private: bool m_synced = false; bool m_stopping = false; int m_restarts = 0; + qint64 m_lastSpawnMs = 0; // wowlet: wall-clock of last spawn — ages out the crash-retry budget static QPointer m_instance; };