From 3aaca6c1e4878c94244d70939467d476a58ad435 Mon Sep 17 00:00:00 2001 From: Gregory Sanders Date: Mon, 10 Jul 2017 08:48:56 -0400 Subject: [PATCH] CHECKSIGFROMSTACK should not have VERIFY semantics --- src/script/interpreter.cpp | 10 +++++++--- src/script/script_error.h | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) 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,