From 05b224a175065aee4d6d9c471722bc4503f01fdf Mon Sep 17 00:00:00 2001 From: Russell Yanofsky Date: Tue, 5 Nov 2019 10:53:07 -0500 Subject: [PATCH] Add missing SetupGeneration error handling in EncryptWallet Suggested https://github.com/bitcoin/bitcoin/pull/17304#discussion_r341286026 by me --- src/wallet/wallet.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 0b7dc256ad..cdcb65e3c0 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -572,7 +572,9 @@ bool CWallet::EncryptWallet(const SecureString& strWalletPassphrase) // if we are using HD, replace the HD seed with a new one if (auto spk_man = m_spk_man.get()) { if (spk_man->IsHDEnabled()) { - spk_man->SetupGeneration(true); + if (!spk_man->SetupGeneration(true)) { + return false; + } } } Lock();