miniscript: make GetStackSize independent of P2WSH context

It was taking into account the P2WSH script push in the number of stack
elements.
This commit is contained in:
Antoine Poinsot
2023-01-23 12:45:49 +01:00
parent 7bf078f2b7
commit 4ab382c2cd
3 changed files with 38 additions and 38 deletions

View File

@@ -973,7 +973,7 @@ void TestNode(const NodeRef& node, FuzzedDataProvider& provider)
if (nonmal_success) {
// Non-malleable satisfactions are bounded by GetStackSize().
assert(witness_nonmal.stack.size() <= *node->GetStackSize());
assert(witness_nonmal.stack.size() <= *node->GetStackSize() + 1);
// If a non-malleable satisfaction exists, the malleable one must also exist, and be identical to it.
assert(mal_success);
assert(witness_nonmal.stack == witness_mal.stack);