aboutsummaryrefslogtreecommitdiff
path: root/src/qt/bitcoingui.cpp
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2022-07-15 11:34:21 -0400
committerAndrew Chow <achow101-github@achow101.com>2022-07-15 11:41:43 -0400
commit4c495413e138ec1dd6874e41b44e689f0c15e0e3 (patch)
treef5761988b35dc436ce9cf7cb55ed6e6a257eb1a4 /src/qt/bitcoingui.cpp
parent85b601e04363664eae1b4b802cd8dde942761939 (diff)
downloadbitcoin-4c495413e138ec1dd6874e41b44e689f0c15e0e3.tar.xz
Disallow encryption of watchonly wallets
Watchonly wallets do not have any private keys to encrypt. It does not make sense to encrypt such wallets, so disable the option to encrypt them. This avoids an assertion that can be hit when encrypting watchonly descriptor wallets.
Diffstat (limited to 'src/qt/bitcoingui.cpp')
-rw-r--r--src/qt/bitcoingui.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index 35e32f515b..baad0fdd91 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -1350,6 +1350,12 @@ void BitcoinGUI::setEncryptionStatus(int status)
{
switch(status)
{
+ case WalletModel::NoKeys:
+ labelWalletEncryptionIcon->hide();
+ encryptWalletAction->setChecked(false);
+ changePassphraseAction->setEnabled(false);
+ encryptWalletAction->setEnabled(false);
+ break;
case WalletModel::Unencrypted:
labelWalletEncryptionIcon->hide();
encryptWalletAction->setChecked(false);