@@ -207,9 +207,11 @@ class BIP32PubkeyProvider final : public PubkeyProvider
207207/* * Base class for all Descriptor implementations. */
208208class DescriptorImpl : public Descriptor
209209{
210- // ! Public key arguments for this descriptor (size 1 for PK, PKH, WPKH; any size of Multisig).
210+ // ! Public key arguments for this descriptor (size 1 for PK, PKH, WPKH; any size for Multisig).
211211 const std::vector<std::unique_ptr<PubkeyProvider>> m_pubkey_args;
212212 // ! The sub-descriptor argument (nullptr for everything but SH and WSH).
213+ // ! In doc/descriptors.m this is referred to as SCRIPT expressions sh(SCRIPT)
214+ // ! and wsh(SCRIPT), and distinct from KEY expressions and ADDR expressions.
213215 const std::unique_ptr<DescriptorImpl> m_subdescriptor_arg;
214216 // ! The string name of the descriptor function.
215217 const std::string m_name;
@@ -295,6 +297,8 @@ class DescriptorImpl : public Descriptor
295297 // Construct temporary data in `entries` and `subscripts`, to avoid producing output in case of failure.
296298 for (const auto & p : m_pubkey_args) {
297299 entries.emplace_back ();
300+ // If we have a cache, we don't need GetPubKey to compute the public key.
301+ // Pass in nullptr to signify only origin info is desired.
298302 if (!p->GetPubKey (pos, arg, cache_read ? nullptr : &entries.back ().first , entries.back ().second )) return false ;
299303 if (cache_read) {
300304 // Cached expanded public key exists, use it.
0 commit comments