Skip to content

Commit

Permalink
qt, wallet: Drop unused parameter in WalletModel::setWalletEncrypted
Browse files Browse the repository at this point in the history
Summary:
This is a backport of [[bitcoin-core/gui#109 | core-gui#109]] [3/3]
bitcoin-core/gui@4146a31

Test Plan: `ninja all check-all`

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D10739
  • Loading branch information
hebasto authored and PiRK committed Dec 23, 2021
1 parent ca88506 commit 6e36ac1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/qt/askpassphrasedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ void AskPassphraseDialog::accept() {
encryption_reminder + "</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. ") +
Expand Down
8 changes: 2 additions & 6 deletions src/qt/walletmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,12 +338,8 @@ WalletModel::EncryptionStatus WalletModel::getEncryptionStatus() const {
}
}

bool WalletModel::setWalletEncrypted(bool encrypted,
const SecureString &passphrase) {
if (encrypted) {
return m_wallet->encryptWallet(passphrase);
}
return false;
bool WalletModel::setWalletEncrypted(const SecureString &passphrase) {
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 @@ -104,7 +104,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());
Expand Down

0 comments on commit 6e36ac1

Please sign in to comment.