Skip to content

Commit

Permalink
Merge #6522: fix: cache descriptors of wallet unlock - missing change…
Browse files Browse the repository at this point in the history
…s from bitcoin#21329

b7500c4 fix: cache descriptors of wallet unlock - missing changes from bitcoin#21329 (Konstantin Akimov)

Pull request description:

  ## Issue being fixed or feature implemented
  Steps to reproduce:
   - create descriptor wallet with passphrase
   - lock wallet
   - call rpc `listdescriptors` and `listdescriptors true`

  Both RPC calls are failed, while first call `listdescriptors` should succeed: it doesn't need any private key but fails if descriptor wallet is locked

  ## What was done?
  Added missing changes from backport bitcoin#21329

  ## How Has This Been Tested?
   - unlock descriptor wallet (to update caches)
   - lock wallet
   - `listdescriptors` succeeded as expected, `listdescriptors true` failed as expected because it requires private keys.

  ## Breaking Changes
  N/A

  ## Checklist:
  - [x] I have performed a self-review of my own code
  - [ ] I have commented my code, particularly in hard-to-understand areas
  - [ ] I have added or updated relevant unit/integration/functional/e2e tests
  - [ ] I have made corresponding changes to the documentation
  - [x] I have assigned this pull request to a milestone

ACKs for top commit:
  UdjinM6:
    utACK b7500c4
  PastaPastaPasta:
    utACK b7500c4

Tree-SHA512: 9cc0051d856de67a3f92d4cb1734eaf3bf0b1457b5e7e09406b25dadeda88e4a0a82f32a71aa55ad26ea9a35dc3814a22eb2d770edfea1131ca5ad13bbdb62ca
  • Loading branch information
PastaPastaPasta committed Jan 11, 2025
2 parents f722c7e + b7500c4 commit ae68ed3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5648,6 +5648,8 @@ bool CWallet::Unlock(const SecureString& strWalletPassphrase, bool fForMixingOnl
if (Unlock(_vMasterKey, fForMixingOnly, accept_no_keys)) {
// Now that we've unlocked, upgrade the key metadata
UpgradeKeyMetadata();
// Now that we've unlocked, upgrade the descriptor cache
UpgradeDescriptorCache();
if(nWalletBackups == -2) {
TopUpKeyPool();
WalletLogPrintf("Keypool replenished, re-initializing automatic backups.\n");
Expand Down

0 comments on commit ae68ed3

Please sign in to comment.