]> Nutra Git (v2) - gamesguru/feather.git/commitdiff
WindowManager: warn on non-deterministic wallet
authortobtoht <thotbot@protonmail.com>
Fri, 4 Mar 2022 16:57:00 +0000 (17:57 +0100)
committertobtoht <thotbot@protonmail.com>
Fri, 4 Mar 2022 16:57:00 +0000 (17:57 +0100)
src/WindowManager.cpp

index 1c4a1468b4ec3bdc5a063ca5176d880d6f1d7767..47f1866c2a6837a5fcd34d96ed7cc26eaaf79e9c 100644 (file)
@@ -195,6 +195,21 @@ void WindowManager::onWalletOpened(Wallet *wallet) {
         }
     }
 
+    if (!wallet->viewOnly() && !wallet->isHwBacked()) {
+        if (!wallet->isDeterministic()) {
+            auto result = QMessageBox::question(nullptr, "Non-deterministic wallet",
+                                                "This wallet is not deterministic. This may be caused by a corrupt keys file. "
+                                                "If you are unsure what this means, RESTORE YOUR WALLET FROM SEED.\n\n"
+                                                "USING THIS WALLET FILE MAY RESULT IN A LOSS OF FUNDS.\n\n"
+                                                "Open this wallet anyway?");
+            if (result == QMessageBox::No) {
+                wallet->deleteLater();
+                this->initWizard();
+                return;
+            }
+        }
+    }
+
     // Create new mainwindow with wallet
 
     m_splashDialog->hide();