Skip to content

Commit 11604f6

Browse files
committed
Remove unused status parameter
1 parent 71dccbe commit 11604f6

File tree

5 files changed

+11
-27
lines changed

5 files changed

+11
-27
lines changed

src/qt/askpassphrasedialog.cpp

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,9 @@ void AskPassphraseDialog::accept()
104104
tr("Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR COINS</b>!") + "<br><br>" + tr("Are you sure you wish to encrypt your wallet?"),
105105
QMessageBox::Yes|QMessageBox::Cancel,
106106
QMessageBox::Cancel);
107-
if(retval == QMessageBox::Yes)
108-
{
109-
if(newpass1 == newpass2)
110-
{
111-
if(model->setWalletEncrypted(true, newpass1))
112-
{
107+
if(retval == QMessageBox::Yes) {
108+
if(newpass1 == newpass2) {
109+
if(model->setWalletEncrypted(newpass1)) {
113110
QMessageBox::warning(this, tr("Wallet encrypted"),
114111
"<qt>" +
115112
tr("Gridcoin will close now to finish the encryption process. "
@@ -123,24 +120,19 @@ void AskPassphraseDialog::accept()
123120
"</b></qt>");
124121
QApplication::quit();
125122
}
126-
else
127-
{
123+
else {
128124
QMessageBox::critical(this, tr("Wallet encryption failed"),
129125
tr("Wallet encryption failed due to an internal error. Your wallet was not encrypted."));
130126
}
131127
QDialog::accept(); // Success
132-
}
133-
else
134-
{
128+
} else {
135129
QMessageBox::critical(this, tr("Wallet encryption failed"),
136130
tr("The supplied passphrases do not match."));
137131
}
138-
}
139-
else
140-
{
132+
} else {
141133
QDialog::reject(); // Cancelled
142134
}
143-
} break;
135+
} break;
144136
case UnlockStaking:
145137
case Unlock:
146138
if(!model->setWalletLocked(false, oldpass))

src/qt/bitcoingui.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1494,7 +1494,7 @@ void BitcoinGUI::setEncryptionStatus(int status)
14941494
}
14951495
}
14961496

1497-
void BitcoinGUI::encryptWallet(bool status)
1497+
void BitcoinGUI::encryptWallet()
14981498
{
14991499
if(!walletModel)
15001500
return;

src/qt/bitcoingui.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ private slots:
256256
*/
257257
void incomingTransaction(const QModelIndex & parent, int start, int end);
258258
/** Encrypt the wallet */
259-
void encryptWallet(bool status);
259+
void encryptWallet();
260260
/** Backup the wallet */
261261
void backupWallet();
262262
/** Change encrypted wallet passphrase */

src/qt/walletmodel.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -323,17 +323,9 @@ WalletModel::EncryptionStatus WalletModel::getEncryptionStatus() const
323323
}
324324
}
325325

326-
bool WalletModel::setWalletEncrypted(bool encrypted, const SecureString &passphrase)
326+
bool WalletModel::setWalletEncrypted(const SecureString& passphrase)
327327
{
328-
if(encrypted)
329-
{
330-
// Encrypt
331328
return wallet->EncryptWallet(passphrase);
332-
}
333-
else
334-
{
335-
return false;
336-
}
337329
}
338330

339331
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
@@ -91,7 +91,7 @@ class WalletModel : public QObject
9191
SendCoinsReturn sendCoins(const QList<SendCoinsRecipient>& recipients, const CCoinControl* coinControl = nullptr);
9292

9393
// Wallet encryption
94-
bool setWalletEncrypted(bool encrypted, const SecureString& passphrase);
94+
bool setWalletEncrypted(const SecureString& passphrase);
9595
// Passphrase only needed when unlocking
9696
bool setWalletLocked(bool locked, const SecureString& passPhrase=SecureString());
9797
bool changePassphrase(const SecureString& oldPass, const SecureString& newPass);

0 commit comments

Comments
 (0)