Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Comment on lines 1366 to 1375
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

easier would be:

for ...
  if ! enabled: return false;
return true;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not quite, since we need to return false of the init value in case the for loop is never entered. afaics.

}
Expand Down