From 892436c7d575ffdb9bada5fe4e62d6c1f5053c42 Mon Sep 17 00:00:00 2001 From: Antoine Poinsot Date: Thu, 21 Sep 2023 16:43:52 +0200 Subject: [PATCH] miniscript: sanity asserts context in ComputeType --- src/script/miniscript.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/script/miniscript.cpp b/src/script/miniscript.cpp index 15e0778ef57..c133f88709a 100644 --- a/src/script/miniscript.cpp +++ b/src/script/miniscript.cpp @@ -71,8 +71,10 @@ Type ComputeType(Fragment fragment, Type x, Type y, Type z, const std::vector= 1 && n_keys <= MAX_PUBKEYS_PER_MULTISIG); + assert(!IsTapscript(ms_ctx)); } else if (fragment == Fragment::MULTI_A) { assert(n_keys >= 1 && n_keys <= MAX_PUBKEYS_PER_MULTI_A); + assert(IsTapscript(ms_ctx)); } else { assert(n_keys == 0); } @@ -215,8 +217,12 @@ Type ComputeType(Fragment fragment, Type x, Type y, Type z, const std::vector