From 1e996640e643890cbeb6760298f50a3ff87ce7cf Mon Sep 17 00:00:00 2001 From: Ava Chow Date: Mon, 12 May 2025 15:42:51 -0700 Subject: [PATCH] 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. --- src/wallet/scriptpubkeyman.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallet/scriptpubkeyman.cpp b/src/wallet/scriptpubkeyman.cpp index 0759e2d5220..738b0e63430 100644 --- a/src/wallet/scriptpubkeyman.cpp +++ b/src/wallet/scriptpubkeyman.cpp @@ -1222,7 +1222,7 @@ bool DescriptorScriptPubKeyMan::CanGetAddresses(bool internal) const LOCK(cs_desc_man); return m_wallet_descriptor.descriptor->IsSingleType() && m_wallet_descriptor.descriptor->IsRange() && - (HavePrivateKeys() || m_wallet_descriptor.next_index < m_wallet_descriptor.range_end); + (HavePrivateKeys() || m_wallet_descriptor.next_index < m_wallet_descriptor.range_end || m_wallet_descriptor.descriptor->CanSelfExpand()); } bool DescriptorScriptPubKeyMan::HavePrivateKeys() const