MCPcopy Create free account
hub / github.com/bitcoinxt/bitcoinxt / IsPushOnly

Method IsPushOnly

src/script/script.cpp:213–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

211}
212
213bool CScript::IsPushOnly() const
214{
215 const_iterator pc = begin();
216 while (pc < end())
217 {
218 opcodetype opcode;
219 if (!GetOp(pc, opcode))
220 return false;
221 // Note that IsPushOnly() *does* consider OP_RESERVED to be a
222 // push-type opcode, however execution of OP_RESERVED fails, so
223 // it's not relevant to P2SH/BIP62 as the scriptSig would fail prior to
224 // the P2SH special validation code being executed.
225 if (opcode > OP_16)
226 return false;
227 }
228 return true;
229}
230
231bool CScript::IsCommitment(const std::vector<unsigned char> &data) const {
232 // To ensure we have an immediate push, we limit the commitment size to 64

Callers 3

BOOST_FOREACHFunction · 0.80
VerifyScriptFunction · 0.80
BOOST_AUTO_TEST_CASEFunction · 0.80

Calls

no outgoing calls

Tested by 1

BOOST_AUTO_TEST_CASEFunction · 0.64