Skip to content

Commit c26bbec

Browse files
committed
wallet: Use Descriptor::CanSelfExpand() in CanGetAddresses()
If a descriptor does not need any caches or private keys in order to expand, then CanGetAddresses() should return true for that descriptor.
1 parent 49d0c4e commit c26bbec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/wallet/scriptpubkeyman.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1174,7 +1174,7 @@ bool DescriptorScriptPubKeyMan::CanGetAddresses(bool internal) const
11741174
LOCK(cs_desc_man);
11751175
return m_wallet_descriptor.descriptor->IsSingleType() &&
11761176
m_wallet_descriptor.descriptor->IsRange() &&
1177-
(HavePrivateKeys() || m_wallet_descriptor.next_index < m_wallet_descriptor.range_end);
1177+
(HavePrivateKeys() || m_wallet_descriptor.next_index < m_wallet_descriptor.range_end || m_wallet_descriptor.descriptor->CanSelfExpand());
11781178
}
11791179

11801180
bool DescriptorScriptPubKeyMan::HavePrivateKeys() const

0 commit comments

Comments
 (0)