There is an unnecessary ExtractDestination() call and subsequent result parse into an CScriptID.
The Solver() call, which we are already doing below anyway, retrieves the script type and, in the P2SH case, the program id.
There is an unnecessary ExtractDestination() call and subsequent result parse into an CScriptID.
The Solver() call, which we are already doing below anyway, retrieves the script type and, in the P2SH case, the program id.
Concept ACK
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
ACK 24c82ee0987a39a551f9ab40b95b72e3ed1e224f - LGTM
275 | - if (!ExtractDestination(output.scriptPubKey, destination)) 276 | - continue; 277 | - const CScriptID& hash = CScriptID(std::get<ScriptHash>(destination)); 278 | - if (!provider->GetCScript(hash, script)) 279 | - continue; 280 | + if (type == TxoutType::SCRIPTHASH && solvable) {
In the comment above it is mentioned that we check this if the output is "spendable". But in the conditional we are checking for "solvable", which I think is enough to serve the purpose. Should the comment be updated in that light?
yeah. The comment isn't accurate. Solvable refers to the wallet knowing how to create the unlocking script that spends the output (which is what we are looking for here), while spendable refers to whether the wallet has the key/s to sign the input or not.
tACK 24c82ee0987a39a551f9ab40b95b72e3ed1e224f
Just one non-blocking nit comment not related to changes of this PR.
Done, added @rajarshimaitra feedback.
re-ACK 58b7df3caa21519de61e10f6ee42f0be9ac3cc30
ACK 58b7df3caa21519de61e10f6ee42f0be9ac3cc30
ACK 58b7df3caa21519de61e10f6ee42f0be9ac3cc30