Limit the amount of nesting for `thresh` fragments to 4
compute_thresh_ops and compute_thresh_stacksize each need two arrays of MAX_N_IN_THRESH + 2 counters. Since they were inlined by the compiler, they bloat the size of the stack frame of compute_miniscript_policy_ext_info, which vastly reduces the stack usage on usual policies. Yet, stack usage would remain very large on policies that recursively nest 'thresh' fragments. Therefore, we add a limit of 4 nested thresh expressions, by keeping track in the parsing context.
S
Salvatore Ingala committed
d4e23574004a253506b648e2d6feaf00c503ae22
Parent: ed7cd02