Skip to content

Commit

Permalink
qt: Fix wallet encryption dialog (#3816)
Browse files Browse the repository at this point in the history
Do not rely on `checked` status of `encryptWalletAction`
  • Loading branch information
UdjinM6 authored Nov 15, 2020
1 parent bd4a2ed commit 3391bd6
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ void BitcoinGUI::createActions()
#ifdef ENABLE_WALLET
if(walletFrame)
{
connect(encryptWalletAction, SIGNAL(triggered(bool)), walletFrame, SLOT(encryptWallet(bool)));
connect(encryptWalletAction, SIGNAL(triggered()), walletFrame, SLOT(encryptWallet()));
connect(backupWalletAction, SIGNAL(triggered()), walletFrame, SLOT(backupWallet()));
connect(changePassphraseAction, SIGNAL(triggered()), walletFrame, SLOT(changePassphrase()));
connect(unlockWalletAction, SIGNAL(triggered()), walletFrame, SLOT(unlockWallet()));
Expand Down
4 changes: 2 additions & 2 deletions src/qt/walletframe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,11 @@ void WalletFrame::gotoVerifyMessageTab(QString addr)
walletView->gotoVerifyMessageTab(addr);
}

void WalletFrame::encryptWallet(bool status)
void WalletFrame::encryptWallet()
{
WalletView *walletView = currentWalletView();
if (walletView)
walletView->encryptWallet(status);
walletView->encryptWallet();
}

void WalletFrame::backupWallet()
Expand Down
2 changes: 1 addition & 1 deletion src/qt/walletframe.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public Q_SLOTS:
void gotoVerifyMessageTab(QString addr = "");

/** Encrypt the wallet */
void encryptWallet(bool status);
void encryptWallet();
/** Backup the wallet */
void backupWallet();
/** Change encrypted wallet passphrase */
Expand Down
4 changes: 2 additions & 2 deletions src/qt/walletview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,11 +308,11 @@ void WalletView::updateEncryptionStatus()
Q_EMIT encryptionStatusChanged();
}

void WalletView::encryptWallet(bool status)
void WalletView::encryptWallet()
{
if(!walletModel)
return;
AskPassphraseDialog dlg(status ? AskPassphraseDialog::Encrypt : AskPassphraseDialog::Decrypt, this);
AskPassphraseDialog dlg(AskPassphraseDialog::Encrypt, this);
dlg.setModel(walletModel);
dlg.exec();

Expand Down
2 changes: 1 addition & 1 deletion src/qt/walletview.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public Q_SLOTS:
*/
void processNewTransaction(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 */
Expand Down

0 comments on commit 3391bd6

Please sign in to comment.