MCPcopy Create free account
hub / github.com/bitcoin-sv/bitcoin-sv / IsPushOnly

Method IsPushOnly

src/script/script.cpp:205–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

203}
204
205bool CScript::IsPushOnly(const_iterator pc) const
206{
207 while(pc < end())
208 {
209 opcodetype opcode; //NOLINT(cppcoreguidelines-init-variables)
210 if (!GetOp(pc, opcode)) return false;
211 // Note that IsPushOnly() *does* consider OP_RESERVED to be a push-type
212 // opcode, however execution of OP_RESERVED fails, so it's not relevant
213 // to P2SH/BIP62 as the scriptSig would fail prior to the P2SH special
214 // validation code being executed.
215 if (opcode > OP_16) return false;
216 }
217 return true;
218}
219
220bool CScript::IsPushOnly() const {
221 return this->IsPushOnly(begin());

Callers 4

VerifyScriptFunction · 0.80
SolverFunction · 0.80
IsStandardTxFunction · 0.80
BOOST_AUTO_TEST_CASEFunction · 0.80

Calls

no outgoing calls

Tested by 1

BOOST_AUTO_TEST_CASEFunction · 0.64