From ccef3b48363d8bff4b919d9119355182e3902ef3 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Mon, 16 Nov 2020 00:19:03 +0300 Subject: [PATCH] qt: Fix wallet encryption dialog (#3816) Do not rely on `checked` status of `encryptWalletAction` --- src/qt/bitcoingui.cpp | 2 +- src/qt/walletframe.cpp | 4 ++-- src/qt/walletframe.h | 2 +- src/qt/walletview.cpp | 4 ++-- src/qt/walletview.h | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 2e0dced4b9..e128f3b258 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -575,7 +575,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())); diff --git a/src/qt/walletframe.cpp b/src/qt/walletframe.cpp index 7c55792059..ca1ae0d0a0 100644 --- a/src/qt/walletframe.cpp +++ b/src/qt/walletframe.cpp @@ -166,11 +166,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() diff --git a/src/qt/walletframe.h b/src/qt/walletframe.h index 02340d1027..9f1961d9b9 100644 --- a/src/qt/walletframe.h +++ b/src/qt/walletframe.h @@ -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 */ diff --git a/src/qt/walletview.cpp b/src/qt/walletview.cpp index 2bb1a177ad..4abf863e14 100644 --- a/src/qt/walletview.cpp +++ b/src/qt/walletview.cpp @@ -299,11 +299,11 @@ void WalletView::updateEncryptionStatus() Q_EMIT encryptionStatusChanged(walletModel->getEncryptionStatus()); } -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(); diff --git a/src/qt/walletview.h b/src/qt/walletview.h index c6b5ab5c31..6a041ac7f9 100644 --- a/src/qt/walletview.h +++ b/src/qt/walletview.h @@ -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 */