MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / CheckStackSize

Method CheckStackSize

src/script/miniscript.h:1595–1604  ·  view source on GitHub ↗

Check the maximum stack size for this script against the policy limit.

Source from the content-addressed store, hash-verified

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(); }

Callers 3

TestSatisfyMethod · 0.80
BOOST_AUTO_TEST_CASEFunction · 0.80
TestNodeFunction · 0.80

Calls 1

IsTapscriptFunction · 0.85

Tested by 3

TestSatisfyMethod · 0.64
BOOST_AUTO_TEST_CASEFunction · 0.64
TestNodeFunction · 0.64