aboutsummaryrefslogtreecommitdiff
path: root/src/qt
diff options
context:
space:
mode:
authorMeshCollider <dobsonsa68@gmail.com>2018-10-13 16:57:15 +0900
committerMeshCollider <dobsonsa68@gmail.com>2018-11-10 15:07:20 +1300
commitb4f6e58ca5a74225b6db9deb3ffe1ce3ab19a790 (patch)
tree5dc42277768cbbac45dda89a88e58145da9348f0 /src/qt
parentbe992701b018f256db6d64786624be4cb60d8975 (diff)
Better error message for user when corrupt wallet unlock fails
Diffstat (limited to 'src/qt')
-rw-r--r--src/qt/askpassphrasedialog.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/qt/askpassphrasedialog.cpp b/src/qt/askpassphrasedialog.cpp
index a0270daf99..821c23c467 100644
--- a/src/qt/askpassphrasedialog.cpp
+++ b/src/qt/askpassphrasedialog.cpp
@@ -152,14 +152,15 @@ void AskPassphraseDialog::accept()
}
} break;
case Unlock:
- if(!model->setWalletLocked(false, oldpass))
- {
- QMessageBox::critical(this, tr("Wallet unlock failed"),
- tr("The passphrase entered for the wallet decryption was incorrect."));
- }
- else
- {
- QDialog::accept(); // Success
+ try {
+ if (!model->setWalletLocked(false, oldpass)) {
+ QMessageBox::critical(this, tr("Wallet unlock failed"),
+ tr("The passphrase entered for the wallet decryption was incorrect."));
+ } else {
+ QDialog::accept(); // Success
+ }
+ } catch (const std::runtime_error& e) {
+ QMessageBox::critical(this, tr("Wallet unlock failed"), e.what());
}
break;
case Decrypt: