Show warning on corrupted keys

This commit is contained in:
tobtoht
2022-03-12 13:53:46 +01:00
parent 3e2de76f7d
commit 28c1973405
8 changed files with 37 additions and 8 deletions
+9
View File
@@ -377,6 +377,7 @@ void MainWindow::initWalletContext() {
connect(m_ctx.get(), &AppContext::initiateTransaction, this, &MainWindow::onInitiateTransaction);
connect(m_ctx.get(), &AppContext::endTransaction, this, &MainWindow::onEndTransaction);
connect(m_ctx.get(), &AppContext::customRestoreHeightSet, this, &MainWindow::onCustomRestoreHeightSet);
connect(m_ctx.get(), &AppContext::keysCorrupted, this, &MainWindow::onKeysCorrupted);
// Nodes
connect(m_ctx->nodes, &Nodes::updateStatus, this, &MainWindow::onSetStatusText);
@@ -1439,6 +1440,14 @@ void MainWindow::onCustomRestoreHeightSet(int height) {
this->menuQuitClicked();
}
void MainWindow::onKeysCorrupted() {
if (!m_criticalWarningShown) {
m_criticalWarningShown = true;
QMessageBox::warning(this, "Critical error", "WARNING!\n\nThe wallet keys are corrupted.\n\nTo prevent LOSS OF FUNDS do NOT continue to use this wallet file.\n\nRestore your wallet from seed.\n\nPlease report this incident to the Feather developers.\n\nWARNING!");
m_sendWidget->disableSendButton();
}
}
void MainWindow::onExportHistoryCSV(bool checked) {
if (m_ctx->wallet == nullptr)
return;