From 11604f63ab998144c2cc0780be1e526c05b9352d Mon Sep 17 00:00:00 2001 From: barton26 Date: Tue, 24 Aug 2021 20:14:57 -0400 Subject: [PATCH] Remove unused status parameter --- src/qt/askpassphrasedialog.cpp | 22 +++++++--------------- src/qt/bitcoingui.cpp | 2 +- src/qt/bitcoingui.h | 2 +- src/qt/walletmodel.cpp | 10 +--------- src/qt/walletmodel.h | 2 +- 5 files changed, 11 insertions(+), 27 deletions(-) diff --git a/src/qt/askpassphrasedialog.cpp b/src/qt/askpassphrasedialog.cpp index 9f3f325abd..c1c1dc70ca 100644 --- a/src/qt/askpassphrasedialog.cpp +++ b/src/qt/askpassphrasedialog.cpp @@ -104,12 +104,9 @@ void AskPassphraseDialog::accept() tr("Warning: If you encrypt your wallet and lose your passphrase, you will LOSE ALL OF YOUR COINS!") + "

" + tr("Are you sure you wish to encrypt your wallet?"), QMessageBox::Yes|QMessageBox::Cancel, QMessageBox::Cancel); - if(retval == QMessageBox::Yes) - { - if(newpass1 == newpass2) - { - if(model->setWalletEncrypted(true, newpass1)) - { + if(retval == QMessageBox::Yes) { + if(newpass1 == newpass2) { + if(model->setWalletEncrypted(newpass1)) { QMessageBox::warning(this, tr("Wallet encrypted"), "" + tr("Gridcoin will close now to finish the encryption process. " @@ -123,24 +120,19 @@ void AskPassphraseDialog::accept() ""); QApplication::quit(); } - else - { + else { QMessageBox::critical(this, tr("Wallet encryption failed"), tr("Wallet encryption failed due to an internal error. Your wallet was not encrypted.")); } QDialog::accept(); // Success - } - else - { + } else { QMessageBox::critical(this, tr("Wallet encryption failed"), tr("The supplied passphrases do not match.")); } - } - else - { + } else { QDialog::reject(); // Cancelled } - } break; + } break; case UnlockStaking: case Unlock: if(!model->setWalletLocked(false, oldpass)) diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 35982442f1..8577214993 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -1494,7 +1494,7 @@ void BitcoinGUI::setEncryptionStatus(int status) } } -void BitcoinGUI::encryptWallet(bool status) +void BitcoinGUI::encryptWallet() { if(!walletModel) return; diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index 4bf690f322..4800d0316f 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -256,7 +256,7 @@ private slots: */ void incomingTransaction(const QModelIndex & parent, int start, int end); /** Encrypt the wallet */ - void encryptWallet(bool status); + void encryptWallet(); /** Backup the wallet */ void backupWallet(); /** Change encrypted wallet passphrase */ diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index 013060d6f9..78af87f143 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -323,17 +323,9 @@ WalletModel::EncryptionStatus WalletModel::getEncryptionStatus() const } } -bool WalletModel::setWalletEncrypted(bool encrypted, const SecureString &passphrase) +bool WalletModel::setWalletEncrypted(const SecureString& passphrase) { - if(encrypted) - { - // Encrypt return wallet->EncryptWallet(passphrase); - } - else - { - return false; - } } bool WalletModel::setWalletLocked(bool locked, const SecureString &passPhrase) diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h index 03be37d084..bd3faccaf3 100644 --- a/src/qt/walletmodel.h +++ b/src/qt/walletmodel.h @@ -91,7 +91,7 @@ class WalletModel : public QObject SendCoinsReturn sendCoins(const QList& recipients, const CCoinControl* coinControl = nullptr); // 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);