mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-16 13:01:19 +02:00
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>
Github-Pull: #22781
Rebased-From: 8733a8e84c
(cherry picked from commit c671c6f4706d17cccfe5c35950235f8777a7975f)
This commit is contained in:
parent
205f84bfb7
commit
ee109b4f28
1 changed files with 3 additions and 2 deletions
|
|
@ -1372,9 +1372,10 @@ CAmountMap CWallet::GetDebit(const CTransaction& tx, const isminefilter& filter)
|
|||
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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue