Handle incorrect passwords properly with export

Fixes !5
This commit is contained in:
Aditya Kulkarni
2019-10-31 14:26:04 -07:00
parent 0d5ea2f5a5
commit 851a13c11b
4 changed files with 87 additions and 98 deletions

View File

@@ -455,12 +455,16 @@ void Controller::unlockIfEncrypted(std::function<void(void)> cb, std::function<v
main->tr("Your wallet is encrypted.\nPlease enter your wallet password"), QLineEdit::Password);
if (password.isEmpty()) {
QMessageBox::critical(main, main->tr("Wallet Decryption Failed"),
main->tr("Please enter a valid password"),
QMessageBox::Ok
);
error();
return;
}
zrpc->unlockWallet(password, [=](json reply) {
if (isJsonSuccess(reply)) {
if (isJsonResultSuccess(reply)) {
cb();
// Refresh the wallet so the encryption status is now in sync.