From 8581ad2961fdb7dc5ff078ee0463d1d3e8d9ec1f Mon Sep 17 00:00:00 2001 From: gg Date: Mon, 19 Jan 2026 01:08:33 -0500 Subject: [PATCH] wip --- src/MainWindow.cpp | 2 +- src/libwalletqt/Wallet.cpp | 25 ++++++++++++++++++------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 79c14e46..a1895887 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -262,7 +262,7 @@ void MainWindow::initStatusBar() { QAction *scanTxAction = new QAction(tr("Import Transaction"), this); m_statusLabelStatus->addAction(scanTxAction); - m_updateNetworkInfoAction = new QAction(tr("Scan Now"), this); + m_updateNetworkInfoAction = new QAction(tr("Scan Mempool & Get Network Info"), this); m_statusLabelStatus->addAction(m_updateNetworkInfoAction); connect(m_actionPauseSync, &QAction::toggled, this, [this](bool checked) { diff --git a/src/libwalletqt/Wallet.cpp b/src/libwalletqt/Wallet.cpp index 3cba2857..543c2301 100644 --- a/src/libwalletqt/Wallet.cpp +++ b/src/libwalletqt/Wallet.cpp @@ -7,6 +7,8 @@ #include #include +#include + #include "AddressBook.h" #include "Coins.h" #include "Subaddress.h" @@ -532,9 +534,13 @@ void Wallet::startRefreshThread() bool shouldScanMempool = m_refreshNow || conf()->get(Config::scanMempoolWhenPaused).toBool(); if (shouldScanMempool) { - qDebug() << "[SYNC PAUSED] Scanning mempool because scans are enabled"; - if (m_scheduler.stopping()) return; - scanMempool(); + if (m_wallet2->get_daemon_address().empty()) { + qDebug() << "[SYNC PAUSED] Skipping mempool scan because daemon address is empty"; + } else { + qDebug() << "[SYNC PAUSED] Scanning mempool because scans are enabled"; + if (m_scheduler.stopping()) return; + scanMempool(); + } } // Update network stats if we just scanned OR if we don't have stats yet (startup recovery) @@ -1156,7 +1162,9 @@ void Wallet::createTransaction(const QString &address, quint64 amount, const QSt currentSubaddressAccount(), subaddr_indices, m_selectedInputs, subtractFeeFromAmount); QVector addresses{address}; - this->onTransactionCreated(ptImpl, addresses); + QMetaObject::invokeMethod(this, [this, ptImpl, addresses] { + this->onTransactionCreated(ptImpl, addresses); + }, Qt::QueuedConnection); }); } @@ -1180,7 +1188,9 @@ void Wallet::createTransactionMultiDest(const QVector &addresses, const static_cast(feeLevel), currentSubaddressAccount(), subaddr_indices, m_selectedInputs, subtractFeeFromAmount); - this->onTransactionCreated(ptImpl, addresses); + QMetaObject::invokeMethod(this, [this, ptImpl, addresses] { + this->onTransactionCreated(ptImpl, addresses); + }, Qt::QueuedConnection); }); } @@ -1201,7 +1211,9 @@ void Wallet::sweepOutputs(const QVector &keyImages, QString address, bo static_cast(feeLevel)); QVector addresses {address}; - this->onTransactionCreated(ptImpl, addresses); + QMetaObject::invokeMethod(this, [this, ptImpl, addresses] { + this->onTransactionCreated(ptImpl, addresses); + }, Qt::QueuedConnection); }); } @@ -1209,7 +1221,6 @@ void Wallet::sweepOutputs(const QVector &keyImages, QString address, bo void Wallet::onTransactionCreated(Monero::PendingTransaction *mtx, const QVector &address) { qDebug() << Q_FUNC_INFO; - startRefresh(); PendingTransaction *tx = new PendingTransaction(mtx, this); -- 2.52.0