From e5aaa3d77af7459b37c0c4a37eb22c5fd0cda3e1 Mon Sep 17 00:00:00 2001 From: Antoine Poinsot Date: Sun, 22 Jan 2023 12:49:44 +0100 Subject: 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. --- src/script/miniscript.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/script/miniscript.cpp') diff --git a/src/script/miniscript.cpp b/src/script/miniscript.cpp index 82f65e5dde..15e0778ef5 100644 --- a/src/script/miniscript.cpp +++ b/src/script/miniscript.cpp @@ -33,7 +33,8 @@ Type SanitizeType(Type e) { return e; } -Type ComputeType(Fragment fragment, Type x, Type y, Type z, const std::vector& sub_types, uint32_t k, size_t data_size, size_t n_subs, size_t n_keys) { +Type ComputeType(Fragment fragment, Type x, Type y, Type z, const std::vector& sub_types, uint32_t k, + size_t data_size, size_t n_subs, size_t n_keys, MiniscriptContext ms_ctx) { // Sanity check on data if (fragment == Fragment::SHA256 || fragment == Fragment::HASH256) { assert(data_size == 32); @@ -116,7 +117,8 @@ Type ComputeType(Fragment fragment, Type x, Type y, Type z, const std::vector