Skip to content

Commit

Permalink
qt, wallet: Drop unused parameter in WalletModel::setWalletEncrypted
Browse files Browse the repository at this point in the history
  • Loading branch information
hebasto committed Oct 28, 2020
1 parent f886a20 commit 4146a31
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
7 changes: 2 additions & 5 deletions src/qt/askpassphrasedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,7 @@ void AskPassphraseDialog::accept()
"</b></qt>");
} else {
assert(model != nullptr);
if(model->setWalletEncrypted(true, newpass1))
{
if (model->setWalletEncrypted(newpass1)) {
QMessageBox::warning(this, tr("Wallet encrypted"),
"<qt>" +
tr("Your wallet is now encrypted. ") + encryption_reminder +
Expand All @@ -136,9 +135,7 @@ void AskPassphraseDialog::accept()
"For security reasons, previous backups of the unencrypted wallet file "
"will become useless as soon as you start using the new, encrypted wallet.") +
"</b></qt>");
}
else
{
} else {
QMessageBox::critical(this, tr("Wallet encryption failed"),
tr("Wallet encryption failed due to an internal error. Your wallet was not encrypted."));
}
Expand Down
7 changes: 2 additions & 5 deletions src/qt/walletmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,12 +313,9 @@ WalletModel::EncryptionStatus WalletModel::getEncryptionStatus() const
}
}

bool WalletModel::setWalletEncrypted(bool encrypted, const SecureString &passphrase)
bool WalletModel::setWalletEncrypted(const SecureString& passphrase)
{
if (encrypted) {
return m_wallet->encryptWallet(passphrase);
}
return false;
return m_wallet->encryptWallet(passphrase);
}

bool WalletModel::setWalletLocked(bool locked, const SecureString &passPhrase)
Expand Down
2 changes: 1 addition & 1 deletion src/qt/walletmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class WalletModel : public QObject
SendCoinsReturn sendCoins(WalletModelTransaction &transaction);

// Wallet encryption
bool setWalletEncrypted(bool encrypted, const SecureString &passphrase);
bool setWalletEncrypted(const SecureString& passphrase);
// Passphrase only needed when unlocking
bool setWalletLocked(bool locked, const SecureString &passPhrase=SecureString());
bool changePassphrase(const SecureString &oldPass, const SecureString &newPass);
Expand Down

0 comments on commit 4146a31

Please sign in to comment.