Skip to content

Commit 1cb42b2

Browse files
committed
Generate new descriptors when encrypting
1 parent 82ae02b commit 1cb42b2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/wallet/wallet.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -592,8 +592,11 @@ bool CWallet::EncryptWallet(const SecureString& strWalletPassphrase)
592592
Lock();
593593
Unlock(strWalletPassphrase);
594594

595-
// if we are using HD, replace the HD seed with a new one
596-
if (auto spk_man = GetLegacyScriptPubKeyMan()) {
595+
// If we are using descriptors, make new descriptors with a new seed
596+
if (IsWalletFlagSet(WALLET_FLAG_DESCRIPTORS) && !IsWalletFlagSet(WALLET_FLAG_BLANK_WALLET)) {
597+
SetupDescriptorScriptPubKeyMans();
598+
} else if (auto spk_man = GetLegacyScriptPubKeyMan()) {
599+
// if we are using HD, replace the HD seed with a new one
597600
if (spk_man->IsHDEnabled()) {
598601
if (!spk_man->SetupGeneration(true)) {
599602
return false;

0 commit comments

Comments
 (0)