Skip to content

Commit 8623c35

Browse files
committed
Application of the anti-inscriptions patch
1 parent 1101837 commit 8623c35

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/script/interpreter.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,14 @@ bool EvalScript(std::vector<std::vector<unsigned char> >& stack, const CScript&
479479
return set_error(serror, SCRIPT_ERR_MINIMALDATA);
480480
}
481481
stack.push_back(vchPushValue);
482+
if ((flags & SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS) && opcode == OP_FALSE) {
483+
auto pc_tmp = pc;
484+
opcodetype next_opcode;
485+
valtype dummy_data;
486+
if (script.GetOp(pc_tmp, next_opcode, dummy_data) && next_opcode == OP_IF) {
487+
return set_error(serror, SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS);
488+
}
489+
}
482490
} else if (fExec || (OP_IF <= opcode && opcode <= OP_ENDIF))
483491
switch (opcode)
484492
{

0 commit comments

Comments
 (0)