aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/qt/walletmodel.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp
index 9821f8504a..c2da76fc15 100644
--- a/src/qt/walletmodel.cpp
+++ b/src/qt/walletmodel.cpp
@@ -448,6 +448,13 @@ void WalletModel::unsubscribeFromCoreSignals()
// WalletModel::UnlockContext implementation
WalletModel::UnlockContext WalletModel::requestUnlock()
{
+ // Bugs in earlier versions may have resulted in wallets with private keys disabled to become "encrypted"
+ // (encryption keys are present, but not actually doing anything).
+ // To avoid issues with such wallets, check if the wallet has private keys disabled, and if so, return a context
+ // that indicates the wallet is not encrypted.
+ if (m_wallet->privateKeysDisabled()) {
+ return UnlockContext(this, /*valid=*/true, /*relock=*/false);
+ }
bool was_locked = getEncryptionStatus() == Locked;
if(was_locked)
{