Skip to content

Commit 0d12ea9

Browse files
committed
fix: wrong if/else branches for key refill in wallet creation
Seems as it doesn't affect behaviour noticeable, but should be fixed
1 parent d2c3dcb commit 0d12ea9

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/wallet/wallet.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4623,18 +4623,13 @@ std::shared_ptr<CWallet> CWallet::Create(interfaces::Chain& chain, interfaces::C
46234623
gArgs.ForceRemoveArg("hdseed");
46244624
gArgs.ForceRemoveArg("mnemonic");
46254625
gArgs.ForceRemoveArg("mnemonicpassphrase");
4626-
}
4626+
} // Otherwise, do not create a new HD chain
4627+
46274628
LOCK(walletInstance->cs_wallet);
46284629
if (walletInstance->IsWalletFlagSet(WALLET_FLAG_DESCRIPTORS)) {
46294630
walletInstance->SetupDescriptorScriptPubKeyMans();
46304631
// SetupDescriptorScriptPubKeyMans already calls SetupGeneration for us so we don't need to call SetupGeneration separately
4631-
}
4632-
} // Otherwise, do not create a new HD chain
4633-
4634-
// Top up the keypool
4635-
{
4636-
LOCK(walletInstance->cs_wallet);
4637-
if (!walletInstance->IsWalletFlagSet(WALLET_FLAG_DESCRIPTORS)) {
4632+
} else { // Top up the keypool
46384633
// Legacy wallets need SetupGeneration here.
46394634
if (auto spk_man = walletInstance->GetLegacyScriptPubKeyMan()) {
46404635
if (spk_man->CanGenerateKeys() && !spk_man->TopUp()) {

0 commit comments

Comments
 (0)