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

Method HasValidOps

src/script/script.cpp:300–311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

298}
299
300bool CScript::HasValidOps() const
301{
302 CScript::const_iterator it = begin();
303 while (it < end()) {
304 opcodetype opcode;
305 std::vector<unsigned char> item;
306 if (!GetOp(it, opcode, item) || opcode > MAX_OPCODE || item.size() > MAX_SCRIPT_ELEMENT_SIZE) {
307 return false;
308 }
309 }
310 return true;
311}
312
313bool GetScriptOp(CScriptBase::const_iterator& pc, CScriptBase::const_iterator end, opcodetype& opcodeRet, std::vector<unsigned char>* pvchRet)
314{

Callers 7

CheckTxScriptsSanityFunction · 0.80
BOOST_AUTO_TEST_CASEFunction · 0.80
FUZZ_TARGETFunction · 0.80
key.cppFile · 0.80
sendrawtransactionFunction · 0.80
submitpackageFunction · 0.80
decodescriptFunction · 0.80

Calls 3

beginFunction · 0.85
endFunction · 0.85
sizeMethod · 0.45

Tested by 2

BOOST_AUTO_TEST_CASEFunction · 0.64
FUZZ_TARGETFunction · 0.64