Skip to content

Commit 4146a31

Browse files
committed
qt, wallet: Drop unused parameter in WalletModel::setWalletEncrypted
1 parent f886a20 commit 4146a31

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

src/qt/askpassphrasedialog.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,7 @@ void AskPassphraseDialog::accept()
125125
"</b></qt>");
126126
} else {
127127
assert(model != nullptr);
128-
if(model->setWalletEncrypted(true, newpass1))
129-
{
128+
if (model->setWalletEncrypted(newpass1)) {
130129
QMessageBox::warning(this, tr("Wallet encrypted"),
131130
"<qt>" +
132131
tr("Your wallet is now encrypted. ") + encryption_reminder +
@@ -136,9 +135,7 @@ void AskPassphraseDialog::accept()
136135
"For security reasons, previous backups of the unencrypted wallet file "
137136
"will become useless as soon as you start using the new, encrypted wallet.") +
138137
"</b></qt>");
139-
}
140-
else
141-
{
138+
} else {
142139
QMessageBox::critical(this, tr("Wallet encryption failed"),
143140
tr("Wallet encryption failed due to an internal error. Your wallet was not encrypted."));
144141
}

src/qt/walletmodel.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -313,12 +313,9 @@ WalletModel::EncryptionStatus WalletModel::getEncryptionStatus() const
313313
}
314314
}
315315

316-
bool WalletModel::setWalletEncrypted(bool encrypted, const SecureString &passphrase)
316+
bool WalletModel::setWalletEncrypted(const SecureString& passphrase)
317317
{
318-
if (encrypted) {
319-
return m_wallet->encryptWallet(passphrase);
320-
}
321-
return false;
318+
return m_wallet->encryptWallet(passphrase);
322319
}
323320

324321
bool WalletModel::setWalletLocked(bool locked, const SecureString &passPhrase)

src/qt/walletmodel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class WalletModel : public QObject
105105
SendCoinsReturn sendCoins(WalletModelTransaction &transaction);
106106

107107
// Wallet encryption
108-
bool setWalletEncrypted(bool encrypted, const SecureString &passphrase);
108+
bool setWalletEncrypted(const SecureString& passphrase);
109109
// Passphrase only needed when unlocking
110110
bool setWalletLocked(bool locked, const SecureString &passPhrase=SecureString());
111111
bool changePassphrase(const SecureString &oldPass, const SecureString &newPass);

0 commit comments

Comments
 (0)