diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index ee3327530c49a..d564a1c83ec92 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -449,6 +449,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) {