Check the maximum stack size for this script against the policy limit.
| 1593 | |
| 1594 | //! Check the maximum stack size for this script against the policy limit. |
| 1595 | bool CheckStackSize() const { |
| 1596 | // Since in Tapscript there is no standardness limit on the script and witness sizes, we may run |
| 1597 | // into the maximum stack size while executing the script. Make sure it doesn't happen. |
| 1598 | if (IsTapscript(m_script_ctx)) { |
| 1599 | if (const auto exec_ss = GetExecStackSize()) return exec_ss <= MAX_STACK_SIZE; |
| 1600 | return true; |
| 1601 | } |
| 1602 | if (const auto ss = GetStackSize()) return *ss <= MAX_STANDARD_P2WSH_STACK_ITEMS; |
| 1603 | return true; |
| 1604 | } |
| 1605 | |
| 1606 | //! Whether no satisfaction exists for this node. |
| 1607 | bool IsNotSatisfiable() const { return !GetStackSize(); } |