aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
diff options
context:
space:
mode:
authorSaibato <saibato.naga@pm.me>2021-08-23 12:49:10 -0400
committerSaibato <saibato.naga@pm.me>2021-08-24 05:10:33 -0400
commit8733a8e84c4b2e484f6ed6159fcf5f29a360d42e (patch)
treeae724fe57020e509aeecc8c2c8cce6d3ba7d94ec /src/wallet
parenteb09c26724e3f714b613788fc506f2ff3a208d2c (diff)
the result of CWallet::IsHDEnabled() was initialized with true.
But in case of no keys or a blank hd wallet the iterator would be skipped and not set to false but true, since the loop would be not entered. That had resulted in a wrong return and subsequent false HD and watch-only icon display in gui when reloading a wallet after closing. Update src/wallet/wallet.cpp Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
Diffstat (limited to 'src/wallet')
-rw-r--r--src/wallet/wallet.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index dbcfc4dac3..6fcede07dc 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -1364,9 +1364,10 @@ 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()) return false;
+ result = true;
}
return result;
}