QAction *scanTxAction = new QAction(tr("Import Transaction"), this);
m_statusLabelStatus->addAction(scanTxAction);
- m_updateNetworkInfoAction = new QAction(tr("Scan Mempool"), this);
+ m_updateNetworkInfoAction = new QAction(tr("Scan mempool when paused"), this);
m_statusLabelStatus->addAction(m_updateNetworkInfoAction);
connect(m_actionPauseSync, &QAction::toggled, this, [this](bool checked) {
ui->radio_airgapUR->setChecked(true);
}
- connect(m_updateNetworkInfoAction, &QAction::triggered, this, [this]() {
+ m_updateNetworkInfoAction->setCheckable(true);
+ connect(m_updateNetworkInfoAction, &QAction::toggled, this, [this](bool checked) {
if (!m_wallet) return;
+
+ m_wallet->setScanMempoolWhenPaused(checked);
- qDebug() << "[UI] User requested network info and scan of mempool";
-
- // FIX: Temporarily connect if we are disconnected/paused
- if (m_wallet->connectionStatus() == Wallet::ConnectionStatus_Disconnected) {
- m_nodes->connectToNode();
+ if (checked) {
+ // Ensure we are connected if enabling
+ if (m_wallet->connectionStatus() == Wallet::ConnectionStatus_Disconnected) {
+ m_nodes->connectToNode();
+ }
}
-
- // Trigger the refresh (sets m_refreshNow = true, bypassing the pause check)
- m_wallet->startRefresh(true);
});
switch(status){
case Wallet::ConnectionStatus_Idle:
{
- if (conf()->get(Config::proxy).toInt() == Config::Proxy::Tor) {
- icon = icons()->icon("status_idle_proxy.svg");
+ // If "Scan Mempool" is active, we show "Idle" (connected/active)
+ if (m_updateNetworkInfoAction->isChecked()) {
+ if (conf()->get(Config::proxy).toInt() == Config::Proxy::Tor) {
+ icon = icons()->icon("status_idle_proxy.svg");
+ } else {
+ icon = icons()->icon("status_idle.svg");
+ }
} else {
- icon = icons()->icon("status_idle.svg");
+ // "True Idle" - just waiting, no network activity
+ icon = icons()->icon("status_waiting.svg");
}
statusStr = this->getPausedStatusText();
m_statusLabelNetStats->hide();
if (elapsed >= std::chrono::seconds(m_refreshInterval) || m_refreshNow)
{
if (m_syncPaused && !m_rangeSyncActive) {
- bool shouldScanMempool = m_refreshNow;
+ bool shouldScanMempool = m_refreshNow || m_scanMempoolWhenPaused;
if (shouldScanMempool) {
if (m_wallet2->get_daemon_address().empty()) {
m_syncPaused = paused;
if (paused) {
pauseRefresh();
+ if (!m_scanMempoolWhenPaused) {
+ m_wallet2->set_offline(true);
+ }
} else {
m_wallet2->set_offline(false);
startRefresh(true);
}
}
+void Wallet::setScanMempoolWhenPaused(bool enabled) {
+ m_scanMempoolWhenPaused = enabled;
+
+ // Immediately trigger a scan if enabled and paused
+ if (enabled && m_syncPaused) {
+ m_wallet2->set_offline(false);
+ startRefresh(true);
+ }
+ else if (!enabled && m_syncPaused) {
+ m_wallet2->set_offline(true);
+ }
+}
+
QDateTime Wallet::lastSyncTime() const {
return m_lastSyncTime;
}
void pauseRefresh();
Q_INVOKABLE void updateNetworkStatus();
+ bool syncPaused() const;
+ void setSyncPaused(bool paused);
+ void setScanMempoolWhenPaused(bool enabled);
+
//! returns current wallet's block height
//! (can be less than daemon's blockchain height when wallet sync in progress)
quint64 blockChainHeight() const;
std::atomic<bool> m_syncPaused{false};
std::atomic<int64_t> m_lastRefreshTime{0};
std::atomic<bool> m_refreshThreadStarted{false};
+ std::atomic<bool> m_scanMempoolWhenPaused{false};
};
#endif // FEATHER_WALLET_H