Skip to content

Commit 648f695

Browse files
committed
Correct sanity-checking script_size calculation
1 parent 80d1598 commit 648f695

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/script/miniscript.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1221,7 +1221,7 @@ inline NodeRef<Key> Parse(Span<const char> in, const Ctx& ctx)
12211221
// n = 1 here because we read the first WRAPPED_EXPR before reaching THRESH
12221222
to_parse.emplace_back(ParseContext::THRESH, 1, k);
12231223
to_parse.emplace_back(ParseContext::WRAPPED_EXPR, -1, -1);
1224-
script_size += 2 + (k > 16);
1224+
script_size += 2 + (k > 16) + (k > 0x7f) + (k > 0x7fff) + (k > 0x7fffff);
12251225
} else if (Const("andor(", in)) {
12261226
to_parse.emplace_back(ParseContext::ANDOR, -1, -1);
12271227
to_parse.emplace_back(ParseContext::CLOSE_BRACKET, -1, -1);

0 commit comments

Comments
 (0)