Skip to content

Commit b7b6f21

Browse files
committed
wallet: Set upgraded descriptor cache flag for newly created wallets
New wallets always have these upgraded. As a belt-and-suspenders, do the upgrade as well, but it should not be necessary. Note that while WalletBatch::LoadWallet also does the upgrade, because newly created wallets do not have the descriptor flag set yet, the upgrade does not run and set the flag.
1 parent 52583d3 commit b7b6f21

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/wallet/wallet.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2921,6 +2921,8 @@ std::shared_ptr<CWallet> CWallet::Create(WalletContext& context, const std::stri
29212921
if ((wallet_creation_flags & WALLET_FLAG_EXTERNAL_SIGNER) || !(wallet_creation_flags & (WALLET_FLAG_DISABLE_PRIVATE_KEYS | WALLET_FLAG_BLANK_WALLET))) {
29222922
if (walletInstance->IsWalletFlagSet(WALLET_FLAG_DESCRIPTORS)) {
29232923
walletInstance->SetupDescriptorScriptPubKeyMans();
2924+
// Ensure that the upgraded flag is set and that caches can support this feature.
2925+
walletInstance->UpgradeDescriptorCache();
29242926
// SetupDescriptorScriptPubKeyMans already calls SetupGeneration for us so we don't need to call SetupGeneration separately
29252927
} else {
29262928
// Legacy wallets need SetupGeneration here.

0 commit comments

Comments
 (0)