mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-02 09:46:52 -05:00
Implement IsHDEnabled in DescriptorScriptPubKeyMan
This commit is contained in:
parent
741122d4c1
commit
ec2f9e1178
2 changed files with 5 additions and 3 deletions
|
@ -1555,7 +1555,8 @@ void DescriptorScriptPubKeyMan::MarkUnusedAddresses(const CScript& script)
|
||||||
|
|
||||||
bool DescriptorScriptPubKeyMan::IsHDEnabled() const
|
bool DescriptorScriptPubKeyMan::IsHDEnabled() const
|
||||||
{
|
{
|
||||||
return false;
|
LOCK(cs_desc_man);
|
||||||
|
return m_wallet_descriptor.descriptor->IsRange();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DescriptorScriptPubKeyMan::CanGetAddresses(bool internal) const
|
bool DescriptorScriptPubKeyMan::CanGetAddresses(bool internal) const
|
||||||
|
|
|
@ -1331,9 +1331,10 @@ CAmount CWallet::GetChange(const CTransaction& tx) const
|
||||||
|
|
||||||
bool CWallet::IsHDEnabled() const
|
bool CWallet::IsHDEnabled() const
|
||||||
{
|
{
|
||||||
|
// All Active ScriptPubKeyMans must be HD for this to be true
|
||||||
bool result = true;
|
bool result = true;
|
||||||
for (const auto& spk_man_pair : m_spk_managers) {
|
for (const auto& spk_man : GetActiveScriptPubKeyMans()) {
|
||||||
result &= spk_man_pair.second->IsHDEnabled();
|
result &= spk_man->IsHDEnabled();
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue