Add a helper for the Taproot control block size check to improve readability and reduce repetition. We currently have three instances of this check.
Build & unit tests succeed on my end.
Add a helper for the Taproot control block size check to improve readability and reduce repetition. We currently have three instances of this check.
Build & unit tests succeed on my end.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/34139.
See the guideline for information on the review process. A summary of reviews will appear here.
Concept ~0 (leaning towards n-a-c-k) d7bbd8de23cdef0d844e359cf3e86b7980510cdb
While this refactor does reduce repetition and also allows reusability in the signingprovider as well, I don’t think it’s worth the code churn imho.
Let’s see what other reviewers have to say on this.
1868@@ -1869,6 +1869,11 @@ static bool ExecuteWitnessScript(const std::span<const valtype>& stack_span, con
1869 return true;
1870 }
1871
1872+bool VerifyTaprootControlBlockSize(std::span<const unsigned char> control)
Added! 2c53c4d3428518b22bd9f372ea70bd546bbd65c3
I don’t want to commit a test case for max size because that would require a 8260-character string, but I did test that locally as well: 21031934357fc5f97a4dfa3c13ed9f3b77219d42
@rkrux thank you for your feedback. Could you have a look at #34142 as well? That’d be a fourth instance of this check.
Both these PRs contain similar changes with minor differences, I was initially confused but later got the intent.
Suggest to keep only 1 PR that contains all the changes, will be easier for the reviewers imho to get the whole context.
billymcbip
DrahtBot
rkrux
janb84
Labels
Refactoring