We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e2a30bc commit d1d7775Copy full SHA for d1d7775
src/script/script.h
@@ -570,17 +570,26 @@ class CScript : public CScriptBase
570
int nFound = 0;
571
if (b.empty())
572
return nFound;
573
- iterator pc = begin();
+ CScript result;
574
+ iterator pc = begin(), pc2 = begin();
575
opcodetype opcode;
576
do
577
{
578
+ result.insert(result.end(), pc2, pc);
579
while (static_cast<size_t>(end() - pc) >= b.size() && std::equal(b.begin(), b.end(), pc))
580
- pc = erase(pc, pc + b.size());
581
+ pc = pc + b.size();
582
++nFound;
583
}
584
+ pc2 = pc;
585
586
while (GetOp(pc, opcode));
587
+
588
+ if (nFound > 0) {
589
+ result.insert(result.end(), pc2, end());
590
+ *this = result;
591
+ }
592
593
594
595
int Find(opcodetype op) const
0 commit comments