From 7330d8c01ac628940d60876b2bffb4074b788ea8 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 23 Aug 2021 09:02:36 -0400 Subject: [PATCH] bugfix: initialize the bool value corresponding to the actual wallet key size the result of the call was initialized with true. But in case of no keys, the iterator would be skipped and not set to false. What had resulted in a wrong return and subsequent false icon display in gui. --- src/wallet/wallet.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index cf869fac0cc..a9191f36d8c 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1364,9 +1364,13 @@ CAmount CWallet::GetDebit(const CTransaction& tx, const isminefilter& filter) co bool CWallet::IsHDEnabled() const { // All Active ScriptPubKeyMans must be HD for this to be true - bool result = true; + bool result = false; for (const auto& spk_man : GetActiveScriptPubKeyMans()) { - result &= spk_man->IsHDEnabled(); + if (spk_man->IsHDEnabled()) { + result = true; + } else { + return false; + } } return result; }