mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-10 10:52:31 -05:00
Generate new descriptors when encrypting
This commit is contained in:
parent
82ae02b165
commit
1cb42b22b1
1 changed files with 5 additions and 2 deletions
|
@ -592,8 +592,11 @@ bool CWallet::EncryptWallet(const SecureString& strWalletPassphrase)
|
||||||
Lock();
|
Lock();
|
||||||
Unlock(strWalletPassphrase);
|
Unlock(strWalletPassphrase);
|
||||||
|
|
||||||
// if we are using HD, replace the HD seed with a new one
|
// If we are using descriptors, make new descriptors with a new seed
|
||||||
if (auto spk_man = GetLegacyScriptPubKeyMan()) {
|
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->IsHDEnabled()) {
|
||||||
if (!spk_man->SetupGeneration(true)) {
|
if (!spk_man->SetupGeneration(true)) {
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue