@@ -462,6 +462,9 @@ void Controller::unlockIfEncrypted(std::function<void(void)> cb, std::function<v
|
|||||||
zrpc->unlockWallet(password, [=](json reply) {
|
zrpc->unlockWallet(password, [=](json reply) {
|
||||||
if (isJsonSuccess(reply)) {
|
if (isJsonSuccess(reply)) {
|
||||||
cb();
|
cb();
|
||||||
|
|
||||||
|
// Refresh the wallet so the encryption status is now in sync.
|
||||||
|
refresh(true);
|
||||||
} else {
|
} else {
|
||||||
QMessageBox::critical(main, main->tr("Wallet Decryption Failed"),
|
QMessageBox::critical(main, main->tr("Wallet Decryption Failed"),
|
||||||
QString::fromStdString(reply["error"].get<json::string_t>()),
|
QString::fromStdString(reply["error"].get<json::string_t>()),
|
||||||
|
|||||||
@@ -296,8 +296,22 @@ void MainWindow::removeWalletEncryption() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ok;
|
||||||
QString password = QInputDialog::getText(this, tr("Wallet Password"),
|
QString password = QInputDialog::getText(this, tr("Wallet Password"),
|
||||||
tr("Please enter your wallet password"), QLineEdit::Password);
|
tr("Please enter your wallet password"), QLineEdit::Password, "", &ok);
|
||||||
|
|
||||||
|
// If cancel was pressed, just return
|
||||||
|
if (!ok) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (password.isEmpty()) {
|
||||||
|
QMessageBox::critical(this, tr("Wallet Decryption Failed"),
|
||||||
|
tr("Please enter a password to decrypt your wallet!"),
|
||||||
|
QMessageBox::Ok
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
rpc->removeWalletEncryption(password, [=] (json res) {
|
rpc->removeWalletEncryption(password, [=] (json res) {
|
||||||
if (isJsonSuccess(res)) {
|
if (isJsonSuccess(res)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user