Skip to content

Commit

Permalink
Remove decrypt
Browse files Browse the repository at this point in the history
  • Loading branch information
barton2526 committed Aug 25, 2021
1 parent 9cd2641 commit 71dccbe
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 29 deletions.
22 changes: 0 additions & 22 deletions src/qt/askpassphrasedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,6 @@ AskPassphraseDialog::AskPassphraseDialog(Mode mode, QWidget* parent)
ui->repeatNewPassphraseEdit->hide();
setWindowTitle(tr("Unlock wallet"));
break;
case Decrypt: // Ask passphrase
ui->warningLabel->setText(tr("This operation needs your wallet passphrase to decrypt the wallet."));
ui->newPassphraseLabel->hide();
ui->newPassphraseEdit->hide();
ui->repeatNewPassphraseLabel->hide();
ui->repeatNewPassphraseEdit->hide();
setWindowTitle(tr("Decrypt wallet"));
break;
case ChangePass: // Ask old passphrase + new passphrase x2
setWindowTitle(tr("Change passphrase"));
ui->warningLabel->setText(tr("Enter the old and new passphrase to the wallet."));
Expand Down Expand Up @@ -162,17 +154,6 @@ void AskPassphraseDialog::accept()
QDialog::accept(); // Success
}
break;
case Decrypt:
if(!model->setWalletEncrypted(false, oldpass))
{
QMessageBox::critical(this, tr("Wallet decryption failed"),
tr("The passphrase entered for the wallet decryption was incorrect."));
}
else
{
QDialog::accept(); // Success
}
break;
case ChangePass:
if(newpass1 == newpass2)
{
Expand Down Expand Up @@ -208,9 +189,6 @@ void AskPassphraseDialog::textChanged()
break;
case UnlockStaking:
case Unlock: // Old passphrase x1
case Decrypt:
acceptable = !ui->oldPassphraseEdit->text().isEmpty();
break;
case ChangePass: // Old passphrase x1, new passphrase x2
acceptable = !ui->oldPassphraseEdit->text().isEmpty() && !ui->newPassphraseEdit->text().isEmpty() && !ui->repeatNewPassphraseEdit->text().isEmpty();
break;
Expand Down
1 change: 0 additions & 1 deletion src/qt/askpassphrasedialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ class AskPassphraseDialog : public QDialog
UnlockStaking, /**< Ask passphrase and unlock */
Unlock, /**< Ask passphrase and unlock */
ChangePass, /**< Ask old passphrase + new passphrase twice */
Decrypt /**< Ask passphrase and decrypt wallet */
};

explicit AskPassphraseDialog(Mode mode, QWidget* parent = nullptr);
Expand Down
9 changes: 4 additions & 5 deletions src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ void BitcoinGUI::createActions()
researcherAction->setToolTip(tr("Open BOINC and beacon settings for Gridcoin"));
toggleHideAction = new QAction(tr("&Show / Hide"), this);
encryptWalletAction = new QAction(tr("&Encrypt Wallet..."), this);
encryptWalletAction->setToolTip(tr("Encrypt or decrypt wallet"));
encryptWalletAction->setToolTip(tr("Encrypt wallet"));
encryptWalletAction->setCheckable(true);
backupWalletAction = new QAction(tr("&Backup Wallet/Config..."), this);
backupWalletAction->setToolTip(tr("Backup wallet/config to another location"));
Expand Down Expand Up @@ -1480,7 +1480,7 @@ void BitcoinGUI::setEncryptionStatus(int status)
changePassphraseAction->setEnabled(true);
unlockWalletAction->setVisible(false);
lockWalletAction->setVisible(true);
encryptWalletAction->setEnabled(false); // TODO: decrypt currently not supported
encryptWalletAction->setEnabled(false);
break;
case WalletModel::Locked:
labelEncryptionIcon->setPixmap(GRC::ScaleStatusIcon(this, ":/icons/status_encryption_locked_" + sSheet));
Expand All @@ -1489,7 +1489,7 @@ void BitcoinGUI::setEncryptionStatus(int status)
changePassphraseAction->setEnabled(true);
unlockWalletAction->setVisible(true);
lockWalletAction->setVisible(false);
encryptWalletAction->setEnabled(false); // TODO: decrypt currently not supported
encryptWalletAction->setEnabled(false);
break;
}
}
Expand All @@ -1498,8 +1498,7 @@ void BitcoinGUI::encryptWallet(bool status)
{
if(!walletModel)
return;
AskPassphraseDialog dlg(status ? AskPassphraseDialog::Encrypt:
AskPassphraseDialog::Decrypt, this);
AskPassphraseDialog dlg(AskPassphraseDialog::Encrypt, this);
dlg.setModel(walletModel);
dlg.exec();

Expand Down
1 change: 0 additions & 1 deletion src/qt/walletmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,6 @@ bool WalletModel::setWalletEncrypted(bool encrypted, const SecureString &passphr
}
else
{
// Decrypt -- TODO; not supported yet
return false;
}
}
Expand Down

0 comments on commit 71dccbe

Please sign in to comment.