Skip to content

Commit 7bbaca9

Browse files
committed
miniscript: explicit the threshold size computation in multi()
1 parent 8323e42 commit 7bbaca9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/script/miniscript.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ size_t ComputeScriptLen(Fragment fragment, Type sub0typ, size_t subsize, uint32_
260260
case Fragment::SHA256: return 4 + 2 + 33;
261261
case Fragment::HASH160:
262262
case Fragment::RIPEMD160: return 4 + 2 + 21;
263-
case Fragment::MULTI: return 3 + (n_keys > 16) + (k > 16) + 34 * n_keys;
263+
case Fragment::MULTI: return 1 + BuildScript(n_keys).size() + BuildScript(k).size() + 34 * n_keys;
264264
case Fragment::AND_V: return subsize;
265265
case Fragment::WRAP_V: return subsize + (sub0typ << "x"_mst);
266266
case Fragment::WRAP_S:

0 commit comments

Comments
 (0)