Skip to content

Commit 5e742d3

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 05ab6bc commit 5e742d3

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
@@ -2909,6 +2909,8 @@ std::shared_ptr<CWallet> CWallet::Create(WalletContext& context, const std::stri
29092909
LOCK(walletInstance->cs_wallet);
29102910
if (walletInstance->IsWalletFlagSet(WALLET_FLAG_DESCRIPTORS)) {
29112911
walletInstance->SetupDescriptorScriptPubKeyMans();
2912+
// Ensure that the upgraded flag is set and that caches can support this feature.
2913+
walletInstance->UpgradeDescriptorCache();
29122914
// SetupDescriptorScriptPubKeyMans already calls SetupGeneration for us so we don't need to call SetupGeneration separately
29132915
} else {
29142916
// Legacy wallets need SetupGeneration here.

0 commit comments

Comments
 (0)