]> Nutra Git (v1) - gamesguru/feather.git/commitdiff
track and emit network/pause status
authorgg <chown_tee@proton.me>
Mon, 12 Jan 2026 22:36:18 +0000 (17:36 -0500)
committergg <chown_tee@proton.me>
Mon, 12 Jan 2026 22:37:26 +0000 (17:37 -0500)
src/libwalletqt/Wallet.cpp
src/libwalletqt/Wallet.h
src/main.cpp

index dc47a03f1f7b5921501a92ffea2722f474f27667..cf1dbc127d2b847d6f1232dd78e630d59064ab63 100644 (file)
@@ -459,6 +459,23 @@ void Wallet::pauseRefresh() {
     m_refreshEnabled = false;
 }
 
+void Wallet::updateNetworkStatus() {
+    const auto future = m_scheduler.run([this] {
+        if (!isHwBacked() || isDeviceConnected()) {
+            quint64 daemonHeight = m_walletImpl->daemonBlockChainHeight();
+            bool success = daemonHeight > 0;
+
+            quint64 targetHeight = 0;
+            if (success) {
+                targetHeight = m_walletImpl->daemonBlockChainTargetHeight();
+            }
+            bool haveHeights = (daemonHeight > 0 && targetHeight > 0);
+
+            emit heightsRefreshed(haveHeights, daemonHeight, targetHeight);
+        }
+    });
+}
+
 void Wallet::startRefreshThread()
 {
     const auto future = m_scheduler.run([this] {
index d09604e46c2a778c31774709188fd628607882cc..0e62d0bbea7e5de3ec32d1ac69228950eed3a0b1 100644 (file)
@@ -217,6 +217,7 @@ public:
     // ##### Synchronization (Refresh) #####
     void startRefresh();
     void pauseRefresh();
+    Q_INVOKABLE void updateNetworkStatus();
 
     //! returns current wallet's block height
     //! (can be less than daemon's blockchain height when wallet sync in progress)
index aa62546cacbd9eed01869b1826435fb2dde94bc7..4c4912ac9f82c2be95d3da1beb3a59fa8f120c93 100644 (file)
@@ -188,6 +188,7 @@ if (AttachConsole(ATTACH_PARENT_PROCESS)) {
         info.emplace_back("Tor", TOR_VERSION);
         info.emplace_back("SSL", QSslSocket::sslLibraryVersionString());
         info.emplace_back("Mode", stagenet ? "Stagenet" : (testnet ? "Testnet" : "Mainnet"));
+        info.emplace_back("Network", conf()->get(Config::syncPaused).toBool() ? "PAUSED" : "ACTIVE");
 
         for (const auto &k: info) {
             qWarning().nospace().noquote() << QString("%1: %2").arg(k.first, k.second);