MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / FindAndDelete

Function FindAndDelete

src/script/interpreter.cpp:281–307  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

279}
280
281int FindAndDelete(CScript& script, const CScript& b)
282{
283 int nFound = 0;
284 if (b.empty())
285 return nFound;
286 CScript result;
287 CScript::const_iterator pc = script.begin(), pc2 = script.begin(), end = script.end();
288 opcodetype opcode;
289 do
290 {
291 result.insert(result.end(), pc2, pc);
292 while (static_cast<size_t>(end - pc) >= b.size() && std::equal(b.begin(), b.end(), pc))
293 {
294 pc = pc + b.size();
295 ++nFound;
296 }
297 pc2 = pc;
298 }
299 while (script.GetOp(pc, opcode));
300
301 if (nFound > 0) {
302 result.insert(result.end(), pc2, end);
303 script = std::move(result);
304 }
305
306 return nFound;
307}
308
309bool EvalScript(std::vector<std::vector<unsigned char> >& stack, const CScript& script, unsigned int flags, const BaseSignatureChecker& checker, SigVersion sigversion, ScriptError* serror)
310{

Callers 3

EvalScriptFunction · 0.70
SignatureHashOldFunction · 0.50
BOOST_AUTO_TEST_CASEFunction · 0.50

Calls 6

GetOpMethod · 0.80
emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
insertMethod · 0.45
sizeMethod · 0.45

Tested by 2

SignatureHashOldFunction · 0.40
BOOST_AUTO_TEST_CASEFunction · 0.40