mirror of
https://github.com/wownero/wowlet.git
synced 2026-10-17 15:21:30 +02:00
fix: mining methods are on WalletManager not Wallet — delegate + setDaemonAddress to embedded node (fixes red builds)
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 = "");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user