Skip to content

Commit 05b224a

Browse files
committed
Add missing SetupGeneration error handling in EncryptWallet
Suggested bitcoin/bitcoin#17304 (comment) by me
1 parent bfd826a commit 05b224a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/wallet/wallet.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,9 @@ bool CWallet::EncryptWallet(const SecureString& strWalletPassphrase)
572572
// if we are using HD, replace the HD seed with a new one
573573
if (auto spk_man = m_spk_man.get()) {
574574
if (spk_man->IsHDEnabled()) {
575-
spk_man->SetupGeneration(true);
575+
if (!spk_man->SetupGeneration(true)) {
576+
return false;
577+
}
576578
}
577579
}
578580
Lock();

0 commit comments

Comments
 (0)