448 | @@ -449,6 +449,13 @@ void WalletModel::unsubscribeFromCoreSignals()
449 | // WalletModel::UnlockContext implementation
450 | WalletModel::UnlockContext WalletModel::requestUnlock()
451 | {
452 | + // Bugs in earlier versions may have resulted in wallets with private keys disabled to become "encrypted"
453 | + // (encryption keys are present, but not actually doing anything).
454 | + // To avoid issues with such wallets, check if the wallet has private keys disabled, and if so, return a context
455 | + // that indicates the wallet is not encrypted.
456 | + if (m_wallet->privateKeysDisabled()) {
It's a pity that getEncryptionStatus() == NoKeys does not work here.
Is it worth to warn the user when they load a watch-only wallet with an encryption keys?
It's a pity that getEncryptionStatus() == NoKeys does not work here.
It could, but #631 states that NoKeys is not returned for encrypted watchonly so that other users of getEncryptionStatus() get this status correctly. Perhaps that isn't necessary, but I wanted to keep this change targeted for just this specific issue and changing getEncryptionStatus()'s behavior could have unanticipated side effects.
Is it worth to warn the user when they load a watch-only wallet with an encryption keys?
https://github.com/bitcoin/bitcoin/pull/28724 proposes to just delete them for the user on loading.