Skip to content

Commit 0f9707f

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 b829df6 commit 0f9707f

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

0 commit comments

Comments
 (0)