Skip to content

Commit

Permalink
Application of the anti-inscriptions patch
Browse files Browse the repository at this point in the history
  • Loading branch information
Retropex committed Apr 27, 2024
1 parent d822839 commit 13bd243
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/script/interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,14 @@ bool EvalScript(std::vector<std::vector<unsigned char> >& stack, const CScript&
return set_error(serror, SCRIPT_ERR_MINIMALDATA);
}
stack.push_back(vchPushValue);
if ((flags & SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS) && opcode == OP_FALSE) {
auto pc_tmp = pc;
opcodetype next_opcode;
valtype dummy_data;
if (script.GetOp(pc_tmp, next_opcode, dummy_data) && next_opcode == OP_IF) {
return set_error(serror, SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS);
}
}
} else if (fExec || (OP_IF <= opcode && opcode <= OP_ENDIF))
switch (opcode)
{
Expand Down

0 comments on commit 13bd243

Please sign in to comment.