Skip to content

Commit 8733a8e

Browse files
Saibatohebasto
andcommitted
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 <[email protected]>
1 parent eb09c26 commit 8733a8e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/wallet/wallet.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1364,9 +1364,10 @@ CAmount CWallet::GetDebit(const CTransaction& tx, const isminefilter& filter) co
13641364
bool CWallet::IsHDEnabled() const
13651365
{
13661366
// All Active ScriptPubKeyMans must be HD for this to be true
1367-
bool result = true;
1367+
bool result = false;
13681368
for (const auto& spk_man : GetActiveScriptPubKeyMans()) {
1369-
result &= spk_man->IsHDEnabled();
1369+
if (!spk_man->IsHDEnabled()) return false;
1370+
result = true;
13701371
}
13711372
return result;
13721373
}

0 commit comments

Comments
 (0)