]> Nutra Git (v2) - gamesguru/feather.git/commitdiff
sync fixes
authorgg <chown_tee@proton.me>
Wed, 14 Jan 2026 13:20:33 +0000 (08:20 -0500)
committergg <chown_tee@proton.me>
Wed, 14 Jan 2026 13:20:33 +0000 (08:20 -0500)
src/MainWindow.cpp
src/libwalletqt/Wallet.cpp
src/plugins/tickers/TickersWidget.cpp
src/widgets/TickerWidget.cpp

index 399053cc4a283cf22fb128486b3b867862127fff..9caf3f5e4e293f5655de9f045c4d4214a84f7d95 100644 (file)
@@ -102,6 +102,7 @@ MainWindow::MainWindow(WindowManager *windowManager, Wallet *wallet, QWidget *pa
 
     connect(m_windowManager, &WindowManager::proxySettingsChanged, this, &MainWindow::onProxySettingsChangedConnect);
     connect(m_windowManager, &WindowManager::updateBalance, m_wallet, &Wallet::updateBalance);
+    connect(m_windowManager, &WindowManager::websocketStatusChanged, m_wallet, &Wallet::updateBalance);
     connect(m_windowManager, &WindowManager::offlineMode, this, &MainWindow::onOfflineMode);
     connect(m_windowManager, &WindowManager::manualFeeSelectionEnabled, this, &MainWindow::onManualFeeSelectionEnabled);
     connect(m_windowManager, &WindowManager::subtractFeeFromAmountEnabled, this, &MainWindow::onSubtractFeeFromAmountEnabled);
@@ -753,6 +754,7 @@ void MainWindow::initWalletContext() {
         // Order is important, first inform UI about a potential disconnect, then reconnect
         this->onConnectionStatusChanged(status);
         m_nodes->autoConnect();
+        this->updateBalance();
     });
 
     connect(m_wallet, &Wallet::heightsRefreshed, this, [this](bool success, quint64 daemonHeight, quint64 targetHeight) {
@@ -915,7 +917,7 @@ void MainWindow::onBalanceUpdated(quint64 balance, quint64 spendable) {
         bool isCacheValid = appData()->prices.lastUpdateTime.isValid();
 
         if (balance > 0 && (balanceFiatAmount == 0.0 || !isCacheValid)) {
-            if (conf()->get(Config::offlineMode).toBool() || m_wallet->connectionStatus() == Wallet::ConnectionStatus_Disconnected) {
+            if (conf()->get(Config::offlineMode).toBool() || conf()->get(Config::disableWebsocket).toBool() || m_wallet->connectionStatus() == Wallet::ConnectionStatus_Disconnected) {
                 suffixStr += " (offline)";
             } else if (!appData()->prices.markets.contains("XMR")) {
                 suffixStr += " (connecting)";
index 485c3e22b120f8a72268716ad8a9aa4697da4828..5d9905e01864ebf402e32f619276b89e07fb47a3 100644 (file)
@@ -427,6 +427,10 @@ void Wallet::initAsync(const QString &daemonAddress, bool trustedDaemon, quint64
             success = m_walletImpl->init(daemonAddress.toStdString(), upperTransactionLimit, m_daemonUsername.toStdString(), m_daemonPassword.toStdString(), m_useSSL, false, proxyAddress.toStdString());
         }
 
+        if (m_scheduler.stopping()) {
+            return;
+        }
+
         setTrustedDaemon(trustedDaemon);
 
         if (success) {
@@ -1627,6 +1631,9 @@ Wallet::~Wallet()
 
     pauseRefresh();
     m_walletImpl->stop();
+    // Stop the wallet2 instance to interrupt any blocking network calls (e.g. init)
+    if (m_wallet2)
+        m_wallet2->stop();
 
     m_scheduler.shutdownWaitForFinished();
 
index e55df61b0c2552cc00edae2fb0eab8936e646c96..b9b3a138670fa6f2645bbdd00d4452a0ae47313b 100644 (file)
@@ -23,6 +23,7 @@ TickersWidget::TickersWidget(QWidget *parent, Wallet *wallet)
            this->setup();
        }
     });
+    connect(windowManager(), &WindowManager::websocketStatusChanged, this, &TickersWidget::updateDisplay);
     this->updateBalance();
 }
 
index f6f525ab8b7a9aa4588e620523db91da6767182a..8c727eb7fdf80387d757701d2e6a322f4f273a9a 100644 (file)
@@ -79,7 +79,7 @@ void BalanceTickerWidget::updateDisplay() {
     bool isCacheFresh = isCacheValid && appData()->prices.lastUpdateTime.secsTo(QDateTime::currentDateTime()) < 3600;
 
     if (balanceFiatAmount == 0.0 || !isCacheValid) {
-        if (conf()->get(Config::offlineMode).toBool() || m_wallet->connectionStatus() == Wallet::ConnectionStatus_Disconnected) {
+        if (conf()->get(Config::offlineMode).toBool() || conf()->get(Config::disableWebsocket).toBool() || m_wallet->connectionStatus() == Wallet::ConnectionStatus_Disconnected) {
             this->setDisplayText("offline");
         } else if (!appData()->prices.markets.contains("XMR")) {
             this->setDisplayText("connecting");