miniscript: make 'd:' have the 'u' property under Tapscript context

In Tapscript MINIMALIF is a consensus rule, so we can rely on the fact
that the `DUP IF [X] ENDIF` will always put an exact 1 on the stack upon
satisfaction.
This commit is contained in:
Antoine Poinsot
2023-01-22 12:49:44 +01:00
parent 687a0b0fa5
commit e5aaa3d77a
3 changed files with 7 additions and 5 deletions

View File

@@ -580,7 +580,7 @@ struct SmartInfo
if (subs > 0) subt.push_back(x);
if (subs > 1) subt.push_back(y);
if (subs > 2) subt.push_back(z);
Type res = miniscript::internal::ComputeType(frag, x, y, z, subt, k, data_size, subs, n_keys);
Type res = miniscript::internal::ComputeType(frag, x, y, z, subt, k, data_size, subs, n_keys, MsCtx::P2WSH);
// Continue if the result is not a valid node.
if ((res << "K"_mst) + (res << "V"_mst) + (res << "B"_mst) + (res << "W"_mst) != 1) continue;