@@ -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." ));
@@ -133,8 +125,7 @@ void AskPassphraseDialog::accept()
133125 " </b></qt>" );
134126 } else {
135127 assert (model != nullptr );
136- if (model->setWalletEncrypted (true , newpass1))
137- {
128+ if (model->setWalletEncrypted (newpass1)) {
138129 QMessageBox::warning (this , tr (" Wallet encrypted" ),
139130 " <qt>" +
140131 tr (" Your wallet is now encrypted. " ) + encryption_reminder +
@@ -144,9 +135,7 @@ void AskPassphraseDialog::accept()
144135 " For security reasons, previous backups of the unencrypted wallet file "
145136 " will become useless as soon as you start using the new, encrypted wallet." ) +
146137 " </b></qt>" );
147- }
148- else
149- {
138+ } else {
150139 QMessageBox::critical (this , tr (" Wallet encryption failed" ),
151140 tr (" Wallet encryption failed due to an internal error. Your wallet was not encrypted." ));
152141 }
@@ -176,17 +165,6 @@ void AskPassphraseDialog::accept()
176165 QMessageBox::critical (this , tr (" Wallet unlock failed" ), e.what ());
177166 }
178167 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 ;
190168 case ChangePass:
191169 if (newpass1 == newpass2)
192170 {
@@ -221,9 +199,6 @@ void AskPassphraseDialog::textChanged()
221199 acceptable = !ui->passEdit2 ->text ().isEmpty () && !ui->passEdit3 ->text ().isEmpty ();
222200 break ;
223201 case Unlock: // Old passphrase x1
224- case Decrypt:
225- acceptable = !ui->passEdit1 ->text ().isEmpty ();
226- break ;
227202 case ChangePass: // Old passphrase x1, new passphrase x2
228203 acceptable = !ui->passEdit1 ->text ().isEmpty () && !ui->passEdit2 ->text ().isEmpty () && !ui->passEdit3 ->text ().isEmpty ();
229204 break ;
0 commit comments