mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-09 10:43:19 -05: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>
This commit is contained in:
parent
eb09c26724
commit
8733a8e84c
1 changed files with 3 additions and 2 deletions
|
@ -1364,9 +1364,10 @@ CAmount CWallet::GetDebit(const CTransaction& tx, const isminefilter& filter) co
|
||||||
bool CWallet::IsHDEnabled() const
|
bool CWallet::IsHDEnabled() const
|
||||||
{
|
{
|
||||||
// All Active ScriptPubKeyMans must be HD for this to be true
|
// All Active ScriptPubKeyMans must be HD for this to be true
|
||||||
bool result = true;
|
bool result = false;
|
||||||
for (const auto& spk_man : GetActiveScriptPubKeyMans()) {
|
for (const auto& spk_man : GetActiveScriptPubKeyMans()) {
|
||||||
result &= spk_man->IsHDEnabled();
|
if (!spk_man->IsHDEnabled()) return false;
|
||||||
|
result = true;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue