Skip to content

Commit 6e95011

Browse files
hebastosehyunc
andcommittedOct 23, 2020
qt, wallet: Remove unused AskPassphraseDialog::Decrypt
Co-authored-by: Sehyun Chung <[email protected]>
1 parent 49984b4 commit 6e95011

File tree

3 files changed

+1
-24
lines changed

3 files changed

+1
-24
lines changed
 

‎src/qt/askpassphrasedialog.cpp

-22
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,6 @@ AskPassphraseDialog::AskPassphraseDialog(Mode _mode, QWidget *parent, SecureStri
5858
ui->passEdit3->hide();
5959
setWindowTitle(tr("Unlock wallet"));
6060
break;
61-
case Decrypt: // Ask passphrase
62-
ui->warningLabel->setText(tr("This operation needs your wallet passphrase to decrypt the wallet."));
63-
ui->passLabel2->hide();
64-
ui->passEdit2->hide();
65-
ui->passLabel3->hide();
66-
ui->passEdit3->hide();
67-
setWindowTitle(tr("Decrypt wallet"));
68-
break;
6961
case ChangePass: // Ask old passphrase + new passphrase x2
7062
setWindowTitle(tr("Change passphrase"));
7163
ui->warningLabel->setText(tr("Enter the old passphrase and new passphrase for the wallet."));
@@ -176,17 +168,6 @@ void AskPassphraseDialog::accept()
176168
QMessageBox::critical(this, tr("Wallet unlock failed"), e.what());
177169
}
178170
break;
179-
case Decrypt:
180-
if(!model->setWalletEncrypted(false, oldpass))
181-
{
182-
QMessageBox::critical(this, tr("Wallet decryption failed"),
183-
tr("The passphrase entered for the wallet decryption was incorrect."));
184-
}
185-
else
186-
{
187-
QDialog::accept(); // Success
188-
}
189-
break;
190171
case ChangePass:
191172
if(newpass1 == newpass2)
192173
{
@@ -221,9 +202,6 @@ void AskPassphraseDialog::textChanged()
221202
acceptable = !ui->passEdit2->text().isEmpty() && !ui->passEdit3->text().isEmpty();
222203
break;
223204
case Unlock: // Old passphrase x1
224-
case Decrypt:
225-
acceptable = !ui->passEdit1->text().isEmpty();
226-
break;
227205
case ChangePass: // Old passphrase x1, new passphrase x2
228206
acceptable = !ui->passEdit1->text().isEmpty() && !ui->passEdit2->text().isEmpty() && !ui->passEdit3->text().isEmpty();
229207
break;

‎src/qt/askpassphrasedialog.h

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ class AskPassphraseDialog : public QDialog
2626
Encrypt, /**< Ask passphrase twice and encrypt */
2727
Unlock, /**< Ask passphrase and unlock */
2828
ChangePass, /**< Ask old passphrase + new passphrase twice */
29-
Decrypt /**< Ask passphrase and decrypt wallet */
3029
};
3130

3231
explicit AskPassphraseDialog(Mode mode, QWidget *parent, SecureString* passphrase_out = nullptr);

‎src/qt/walletview.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ void WalletView::encryptWallet(bool status)
262262
{
263263
if(!walletModel)
264264
return;
265-
AskPassphraseDialog dlg(status ? AskPassphraseDialog::Encrypt : AskPassphraseDialog::Decrypt, this);
265+
AskPassphraseDialog dlg(AskPassphraseDialog::Encrypt, this);
266266
dlg.setModel(walletModel);
267267
dlg.exec();
268268

0 commit comments

Comments
 (0)
Please sign in to comment.