MCPcopy Create free account
hub / github.com/ElementsProject/elements / HasValidOps

Method HasValidOps

src/script/script.cpp:386–397  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

384}
385
386bool CScript::HasValidOps() const
387{
388 CScript::const_iterator it = begin();
389 while (it < end()) {
390 opcodetype opcode;
391 std::vector<unsigned char> item;
392 if (!GetOp(it, opcode, item) || opcode > MAX_OPCODE || item.size() > MAX_SCRIPT_ELEMENT_SIZE) {
393 return false;
394 }
395 }
396 return true;
397}
398
399bool GetScriptOp(CScriptBase::const_iterator& pc, CScriptBase::const_iterator end, opcodetype& opcodeRet, std::vector<unsigned char>* pvchRet)
400{

Callers 6

CheckTxScriptsSanityFunction · 0.80
BOOST_AUTO_TEST_CASEFunction · 0.80
FUZZ_TARGETFunction · 0.80
FUZZ_TARGET_INITFunction · 0.80
FUZZ_TARGET_INITFunction · 0.80
decodescriptFunction · 0.80

Calls 3

beginFunction · 0.85
endFunction · 0.85
sizeMethod · 0.45

Tested by 4

BOOST_AUTO_TEST_CASEFunction · 0.64
FUZZ_TARGETFunction · 0.64
FUZZ_TARGET_INITFunction · 0.64
FUZZ_TARGET_INITFunction · 0.64