mirror of
https://github.com/wownero/wowlet.git
synced 2026-10-30 04:39:57 +01:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
93d13a6568 | ||
|
|
64326119eb |
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
cmake_minimum_required(VERSION 3.18)
|
cmake_minimum_required(VERSION 3.18)
|
||||||
|
|
||||||
project(feather
|
project(feather
|
||||||
VERSION "5.0.2"
|
VERSION "5.0.3"
|
||||||
DESCRIPTION "A free Monero desktop wallet"
|
DESCRIPTION "A free Monero desktop wallet"
|
||||||
LANGUAGES CXX C ASM
|
LANGUAGES CXX C ASM
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
#include "utils/DaemonManager.h"
|
#include "utils/DaemonManager.h"
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
|
#include <QDateTime>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QDirIterator>
|
#include <QDirIterator>
|
||||||
#include <QEventLoop>
|
#include <QEventLoop>
|
||||||
@@ -62,6 +63,11 @@ void DaemonManager::start() {
|
|||||||
if (state == QProcess::ProcessState::Running || state == QProcess::ProcessState::Starting)
|
if (state == QProcess::ProcessState::Running || state == QProcess::ProcessState::Starting)
|
||||||
return;
|
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()) {
|
if (!this->unpackBins()) {
|
||||||
this->setErrorMessage("Unable to unpack the embedded wownerod binary.");
|
this->setErrorMessage("Unable to unpack the embedded wownerod binary.");
|
||||||
return;
|
return;
|
||||||
@@ -85,6 +91,14 @@ void DaemonManager::start() {
|
|||||||
// and surfaces a clear error via handleProcessError().
|
// 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;
|
m_restarts += 1;
|
||||||
if (m_restarts > 4) {
|
if (m_restarts > 4) {
|
||||||
this->setErrorMessage("wownerod failed to start: maximum retries exceeded");
|
this->setErrorMessage("wownerod failed to start: maximum retries exceeded");
|
||||||
@@ -108,6 +122,14 @@ void DaemonManager::start() {
|
|||||||
arguments << "--no-igd"; // no UPnP port mapping
|
arguments << "--no-igd"; // no UPnP port mapping
|
||||||
arguments << "--out-peers" << "16";
|
arguments << "--out-peers" << "16";
|
||||||
arguments << "--log-file" << QDir(dataDir).filePath("wownerod.log");
|
arguments << "--log-file" << QDir(dataDir).filePath("wownerod.log");
|
||||||
|
// wowlet: disable LMDB batch write mode so every block is committed in its own transaction.
|
||||||
|
// Without this, wownero accumulates blocks in a single large write transaction that is ABORTED
|
||||||
|
// (not committed) when the daemon shuts down mid-sync — causing all progress since the last
|
||||||
|
// batch boundary to be silently lost. This is visible in wownerod.log: sessions consistently
|
||||||
|
// revert to a stale height despite a full graceful shutdown sequence. Using "safe" mode is
|
||||||
|
// slower for initial sync but is the only correct choice for an embedded node that starts and
|
||||||
|
// stops with the wallet; the wownero chain is small enough that the overhead is acceptable.
|
||||||
|
arguments << "--db-sync-mode" << "safe";
|
||||||
|
|
||||||
// Full archival by default (wownero's chain is small); prune is an explicit opt-in.
|
// Full archival by default (wownero's chain is small); prune is an explicit opt-in.
|
||||||
if (conf()->get(Config::pruneBlockchain).toBool())
|
if (conf()->get(Config::pruneBlockchain).toBool())
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ private:
|
|||||||
bool m_synced = false;
|
bool m_synced = false;
|
||||||
bool m_stopping = false;
|
bool m_stopping = false;
|
||||||
int m_restarts = 0;
|
int m_restarts = 0;
|
||||||
|
qint64 m_lastSpawnMs = 0; // wowlet: wall-clock of last spawn — ages out the crash-retry budget
|
||||||
|
|
||||||
static QPointer<DaemonManager> m_instance;
|
static QPointer<DaemonManager> m_instance;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user