diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp index acf3f86fc1c..0569ba24bd6 100644 --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -1354,11 +1354,15 @@ bool EvalScript(vector >& stack, const CScript& script, un popstack(stack); popstack(stack); stack.push_back(fSuccess ? vchTrue : vchFalse); + if (opcode == OP_CHECKSIGFROMSTACKVERIFY) - popstack(stack); + { + if (fSuccess) + popstack(stack); + else + return set_error(serror, SCRIPT_ERR_CHECKSIGFROMSTACKVERIFY); + } - if (!fSuccess) - return set_error(serror, SCRIPT_ERR_CHECKSIGVERIFY); } break; diff --git a/src/script/script_error.h b/src/script/script_error.h index d03bf68c383..aede2144df2 100644 --- a/src/script/script_error.h +++ b/src/script/script_error.h @@ -27,6 +27,7 @@ typedef enum ScriptError_t SCRIPT_ERR_CHECKMULTISIGVERIFY, SCRIPT_ERR_CHECKSIGVERIFY, SCRIPT_ERR_NUMEQUALVERIFY, + SCRIPT_ERR_CHECKSIGFROMSTACKVERIFY, /* Logical/Format/Canonical errors */ SCRIPT_ERR_BAD_OPCODE,