From 83a4582266ba39af46596aa13d6182859d528658 Mon Sep 17 00:00:00 2001 From: jwinterm Date: Sat, 20 Jun 2026 08:58:47 -0400 Subject: [PATCH] wowlet: fix tx-proxy port, add configurable node data-dir, mining sync hint - DaemonManager --tx-proxy now uses the Tor that is actually running (torManager()->isLocalTor()) instead of the stored useLocalTor preference, which selected the wrong SOCKS port (managed 19450 vs system 9050) and silently stalled outbound tx broadcasts. - Embedded node: nodeDataDir setting points wownerod at an existing chain (e.g. ~/.wownero) to skip a full re-sync; empty keeps the managed isolated default. - mining.qml: tell the user mining waits until the node is synced. --- src/assets/qml/mining.qml | 2 +- src/utils/DaemonManager.cpp | 18 +++++++++++++++--- src/utils/config.cpp | 1 + src/utils/config.h | 1 + 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/assets/qml/mining.qml b/src/assets/qml/mining.qml index 50d8c8f7..25c4e891 100644 --- a/src/assets/qml/mining.qml +++ b/src/assets/qml/mining.qml @@ -394,7 +394,7 @@ Rectangle { anchors.fill: parent text: { if(mining.daemonMiningState === 0) { - return "Press the pick-axe to start mining!"; + return "Press the pick-axe to start mining once your node is synced!"; } else { return ""; } diff --git a/src/utils/DaemonManager.cpp b/src/utils/DaemonManager.cpp index 6659a16c..7b387d20 100644 --- a/src/utils/DaemonManager.cpp +++ b/src/utils/DaemonManager.cpp @@ -10,6 +10,7 @@ #include #include "utils/config.h" +#include "utils/TorManager.h" #include "utils/Utils.h" DaemonManager::DaemonManager(QObject *parent) @@ -63,15 +64,23 @@ void DaemonManager::start() { return; } + // wowlet: allow pointing the embedded node at an existing chain (e.g. ~/.wownero) to skip a full + // re-sync. Empty = the managed, isolated default. LMDB is single-writer, so the chosen dir must not + // be in use by another running wownerod. + QString dataDir = conf()->get(Config::nodeDataDir).toString().trimmed(); + if (dataDir.isEmpty()) + dataDir = this->blockchainDir; + QDir().mkpath(dataDir); + QStringList arguments; - arguments << "--data-dir" << this->blockchainDir; + arguments << "--data-dir" << dataDir; arguments << "--rpc-bind-ip" << this->rpcHost; arguments << "--rpc-bind-port" << QString::number(this->rpcPort); arguments << "--p2p-bind-port" << QString::number(this->p2pPort); arguments << "--non-interactive"; arguments << "--no-igd"; // no UPnP port mapping arguments << "--out-peers" << "16"; - arguments << "--log-file" << QDir(this->blockchainDir).filePath("wownerod.log"); + arguments << "--log-file" << QDir(dataDir).filePath("wownerod.log"); // Full archival by default (wownero's chain is small); prune is an explicit opt-in. if (conf()->get(Config::pruneBlockchain).toBool()) @@ -84,7 +93,10 @@ void DaemonManager::start() { // Tor it would silently stall broadcasts. Builds without embedded Tor fall back to clearnet relay. #if defined(HAS_TOR_BIN) if (conf()->get(Config::broadcastOverTor).toBool()) { - quint16 torPort = conf()->get(Config::useLocalTor).toBool() + // Use the Tor that's actually running, not the stored preference: a managed Tor listens on + // torManagedPort, an external/system Tor on socks5Port. (Reading Config::useLocalTor here picked + // the wrong port whenever wowlet fell back to a system Tor, so broadcasts silently stalled.) + quint16 torPort = torManager()->isLocalTor() ? conf()->get(Config::socks5Port).toString().toUShort() : conf()->get(Config::torManagedPort).toString().toUShort(); arguments << "--tx-proxy" << QString("tor,127.0.0.1:%1,16").arg(torPort); diff --git a/src/utils/config.cpp b/src/utils/config.cpp index 442a315d..605995a2 100644 --- a/src/utils/config.cpp +++ b/src/utils/config.cpp @@ -67,6 +67,7 @@ static const QHash configStrings = { {Config::skin,{QS("skin"), "Wownero"}}, {Config::runLocalNode,{QS("runLocalNode"), true}}, // wowlet: run own node by default {Config::pruneBlockchain,{QS("pruneBlockchain"), false}}, // full archival by default + {Config::nodeDataDir,{QS("nodeDataDir"), ""}}, // wowlet: custom chain dir (empty = managed default); point at an existing chain to skip re-sync {Config::wownerodPath,{QS("wownerodPath"), ""}}, // optional override; bundled by default {Config::broadcastOverTor,{QS("broadcastOverTor"), true}},// wowlet: --tx-proxy our txs through Tor (hide originating IP) {Config::amountPrecision, {QS("amountPrecision"), 11}}, diff --git a/src/utils/config.h b/src/utils/config.h index 2cba3f83..0cd30b2c 100644 --- a/src/utils/config.h +++ b/src/utils/config.h @@ -75,6 +75,7 @@ public: // Embedded node (wowlet) runLocalNode, pruneBlockchain, + nodeDataDir, wownerodPath, broadcastOverTor,