diff options
author | Pieter Wuille <pieter@wuille.net> | 2022-09-21 09:17:45 -0400 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2022-10-11 09:19:57 +0800 |
commit | c97d924880eaad136c5f7776f05bf887657ccca7 (patch) | |
tree | 6a872b97abeae6654f6e9c539fd5d5b94f4598d0 /src/script/miniscript.h | |
parent | da6fba6fe785ba2c54f9b88dd5b1b4ceb02c18c9 (diff) | |
download | bitcoin-c97d924880eaad136c5f7776f05bf887657ccca7.tar.xz |
Correct sanity-checking script_size calculation
GitHub-Pull: #26149
Rebased-From: 648f6950cd8d9ac767d76a1e302f37c611936a7a
Diffstat (limited to 'src/script/miniscript.h')
-rw-r--r-- | src/script/miniscript.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/script/miniscript.h b/src/script/miniscript.h index ab25fa67b7..c4f41e0adf 100644 --- a/src/script/miniscript.h +++ b/src/script/miniscript.h @@ -1221,7 +1221,7 @@ inline NodeRef<Key> Parse(Span<const char> in, const Ctx& ctx) // n = 1 here because we read the first WRAPPED_EXPR before reaching THRESH to_parse.emplace_back(ParseContext::THRESH, 1, k); to_parse.emplace_back(ParseContext::WRAPPED_EXPR, -1, -1); - script_size += 2 + (k > 16); + script_size += 2 + (k > 16) + (k > 0x7f) + (k > 0x7fff) + (k > 0x7fffff); } else if (Const("andor(", in)) { to_parse.emplace_back(ParseContext::ANDOR, -1, -1); to_parse.emplace_back(ParseContext::CLOSE_BRACKET, -1, -1); |