]> Nutra Git (v1) - gamesguru/feather.git/commitdiff
send, coins: don't allow tx construction during blockchain sync
authortobtoht <tob@featherwallet.org>
Fri, 3 May 2024 10:15:51 +0000 (12:15 +0200)
committertobtoht <tob@featherwallet.org>
Fri, 3 May 2024 10:15:51 +0000 (12:15 +0200)
src/CoinsWidget.cpp
src/libwalletqt/Wallet.cpp

index f592ef1281612b267503b1251d7d1ea21f7046ac..9c582da45f9a195ac221a1003d1ea8355a66ace5 100644 (file)
@@ -212,6 +212,18 @@ void CoinsWidget::viewOutput() {
 }
 
 void CoinsWidget::onSweepOutputs() {
+    if (!m_wallet->isConnected()) {
+        Utils::showError(this, "Unable to create transaction", "Wallet is not connected to a node.",
+                         {"Wait for the wallet to automatically connect to a node.", "Go to File -> Settings -> Network -> Node to manually connect to a node."},
+                         "nodes");
+        return;
+    }
+
+    if (!m_wallet->isSynchronized()) {
+        Utils::showError(this, "Unable to create transaction", "Wallet is not synchronized", {"Wait for wallet synchronization to complete"}, "synchronization");
+        return;
+    }
+
     QVector<CoinsInfo*> selectedCoins = this->currentEntries();
     QVector<QString> keyImages;
 
index c5eb5a8bffc2eccb1633547be31d0868fa43f481..8a4576407f8dc591f80bfe35562eda253ded0f8c 100644 (file)
@@ -487,7 +487,7 @@ void Wallet::onHeightsRefreshed(bool success, quint64 daemonHeight, quint64 targ
             this->syncStatusUpdated(walletHeight, daemonHeight);
         }
 
-        if (walletHeight < (daemonHeight - 1)) {
+        if (walletHeight < (targetHeight - 1)) {
             setConnectionStatus(ConnectionStatus_Synchronizing);
         } else {
             setConnectionStatus(ConnectionStatus_Synchronized);