I found the name m_script_arg to be confusing while reviewing #14646 (review). @sipa let me know if m_subdescriptor_arg is completely wrong.
I also added an explanation of why we call GetPubKey when we don't ask it for a public key.
I found the name m_script_arg to be confusing while reviewing #14646 (review). @sipa let me know if m_subdescriptor_arg is completely wrong.
I also added an explanation of why we call GetPubKey when we don't ask it for a public key.
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
No conflicts as of last run.
294 | @@ -295,6 +295,8 @@ class DescriptorImpl : public Descriptor 295 | // Construct temporary data in `entries` and `subscripts`, to avoid producing output in case of failure. 296 | for (const auto& p : m_pubkey_args) { 297 | entries.emplace_back(); 298 | + // If we have a cache, GetPubKey should not actually return a public key, 299 | + // so we pass a nullprt. We're only interested in uncached origin info.
Typo: nullprt
Fixed
m_script_arg refers to the defined SCRIPT in the descriptor doc, to make it distinct from KEY or ADDR. But subdescriptor is also a clear name so I have no strong preference either way.
294 | @@ -295,6 +295,8 @@ class DescriptorImpl : public Descriptor 295 | // Construct temporary data in `entries` and `subscripts`, to avoid producing output in case of failure. 296 | for (const auto& p : m_pubkey_args) { 297 | entries.emplace_back(); 298 | + // If we have a cache, GetPubKey should not actually return a public key,
"should not" sounds like it should be prohibited from computing the pubkey.
What about "If we have a cache, we don't need GetPubKey to compute the public key. Pass in nullptr to signify only origin info is desired.".
Done
-BEGIN VERIFY SCRIPT-
sed -i -e 's/m_script_arg/m_subdescriptor_arg/g' src/script/descriptor.cpp
-END VERIFY SCRIPT-
Rebased.
@MeshCollider I added a comment referencing SCRIPT in the descriptor docs.
By the way, I noticed that neither DescriptorImpl nor m_subdescriptor_arg show up in the docs, not even in the docs for script/descriptor.cpp. I don't understand Doxygen well enough to know if that's a feature (i.e. because these functions are private).
Plus a few typo fixes.
Miraculously this doesn't need another rebase...
FWIW: I've verified that a disassembly of the bitcoind binary built with this patch applied is identical to a disassembly of the bitcoind binary built against master (as expected).
ACK 2e68ffaf205866e4cea71f64e79bbfb89e17280a