diff options
author | Andrew Chow <achow101-github@achow101.com> | 2022-07-15 11:34:21 -0400 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2022-11-21 10:31:30 +0000 |
commit | 7b7bbc145aedf149c6d8675c7e252b0767bb8652 (patch) | |
tree | 7ca69b820564cabe611f8bd104f3d734643eb44b /src/qt/bitcoingui.cpp | |
parent | a46e17832fd2ecc44943ff7ccff8af443f6239b8 (diff) | |
download | bitcoin-7b7bbc145aedf149c6d8675c7e252b0767bb8652.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.
Github-Pull: bitcoin-core/gui#631
Rebased-From: 4c495413e138ec1dd6874e41b44e689f0c15e0e3
Diffstat (limited to 'src/qt/bitcoingui.cpp')
-rw-r--r-- | src/qt/bitcoingui.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 863225099a..2e65e22d13 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -1310,6 +1310,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); |