Skip to content

Commit

Permalink
Generate new descriptors when encrypting
Browse files Browse the repository at this point in the history
  • Loading branch information
achow101 committed Apr 23, 2020
1 parent 82ae02b commit 1cb42b2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -592,8 +592,11 @@ bool CWallet::EncryptWallet(const SecureString& strWalletPassphrase)
Lock();
Unlock(strWalletPassphrase);

// if we are using HD, replace the HD seed with a new one
if (auto spk_man = GetLegacyScriptPubKeyMan()) {
// If we are using descriptors, make new descriptors with a new seed
if (IsWalletFlagSet(WALLET_FLAG_DESCRIPTORS) && !IsWalletFlagSet(WALLET_FLAG_BLANK_WALLET)) {
SetupDescriptorScriptPubKeyMans();
} else if (auto spk_man = GetLegacyScriptPubKeyMan()) {
// if we are using HD, replace the HD seed with a new one
if (spk_man->IsHDEnabled()) {
if (!spk_man->SetupGeneration(true)) {
return false;
Expand Down

0 comments on commit 1cb42b2

Please sign in to comment.