fix: mining methods are on WalletManager not Wallet — delegate + setDaemonAddress to embedded node (fixes red builds)

This commit is contained in:
jwinterm
2026-06-18 18:59:27 -04:00
parent e0c06d6526
commit 341be7f7e4
3 changed files with 40 additions and 4 deletions
+7 -4
View File
@@ -25,6 +25,7 @@
#include "model/CoinsModel.h"
#include "utils/ScopeGuard.h"
#include "utils/DaemonManager.h"
#include "wallet/wallet2.h"
@@ -114,19 +115,21 @@ bool Wallet::isConnected() const {
}
bool Wallet::startMining(quint32 threads) {
return m_walletImpl->startMining(m_walletImpl->address(0, 0), threads);
auto *wm = WalletManager::instance();
wm->setDaemonAddress(daemonManager()->rpcAddress()); // mine via the embedded local node
return wm->startMining(this->address(0, 0), threads);
}
bool Wallet::stopMining() {
return m_walletImpl->stopMining();
return WalletManager::instance()->stopMining();
}
bool Wallet::isMining() {
return m_walletImpl->isMining();
return WalletManager::instance()->isMining();
}
double Wallet::miningHashRate() {
return m_walletImpl->miningHashRate();
return WalletManager::instance()->miningHashRate();
}
QString Wallet::errorString() const {
+25
View File
@@ -180,6 +180,31 @@ bool WalletManager::walletExists(const QString &path) const
return m_pimpl->walletExists(path.toStdString());
}
void WalletManager::setDaemonAddress(const QString &address)
{
m_pimpl->setDaemonAddress(address.toStdString());
}
bool WalletManager::startMining(const QString &address, quint32 threads)
{
return m_pimpl->startMining(address.toStdString(), threads);
}
bool WalletManager::stopMining()
{
return m_pimpl->stopMining();
}
bool WalletManager::isMining()
{
return m_pimpl->isMining();
}
double WalletManager::miningHashRate()
{
return m_pimpl->miningHashRate();
}
bool WalletManager::verifyWalletPassword(const QString &keys_file_name, const QString &password, bool no_spend_key, uint64_t kdf_rounds) const
{
return m_pimpl->verifyWalletPassword(keys_file_name.toStdString(), password.toStdString(), no_spend_key, kdf_rounds);
+8
View File
@@ -41,6 +41,14 @@ public:
*/
void openWalletAsync(const QString &path, const QString &password, NetworkType::Type nettype = NetworkType::MAINNET, quint64 kdfRounds = 1, const QString &ringDatabasePath = "");
// wowlet: solo mining via the connected daemon (the embedded local node). startMining first
// points the manager at the daemon, then asks it to mine RandomWOW to `address`.
void setDaemonAddress(const QString &address);
bool startMining(const QString &address, quint32 threads = 1);
bool stopMining();
bool isMining();
double miningHashRate();
Wallet * recoveryWallet(const QString &path, const QString &password, const QString &seed, const QString &seed_offset,
NetworkType::Type nettype = NetworkType::MAINNET, quint64 restoreHeight = 0, quint64 kdfRounds = 1, const QString &subaddressLookahead = "");