@@ -207,9 +207,11 @@ class BIP32PubkeyProvider final : public PubkeyProvider
207
207
/* * Base class for all Descriptor implementations. */
208
208
class DescriptorImpl : public Descriptor
209
209
{
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).
211
211
const std::vector<std::unique_ptr<PubkeyProvider>> m_pubkey_args;
212
212
// ! 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.
213
215
const std::unique_ptr<DescriptorImpl> m_subdescriptor_arg;
214
216
// ! The string name of the descriptor function.
215
217
const std::string m_name;
@@ -295,6 +297,8 @@ class DescriptorImpl : public Descriptor
295
297
// Construct temporary data in `entries` and `subscripts`, to avoid producing output in case of failure.
296
298
for (const auto & p : m_pubkey_args) {
297
299
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.
298
302
if (!p->GetPubKey (pos, arg, cache_read ? nullptr : &entries.back ().first , entries.back ().second )) return false ;
299
303
if (cache_read) {
300
304
// Cached expanded public key exists, use it.
0 commit comments