From 004b4e49205a37f7e07ea1a21bb61d79f6d09b18 Mon Sep 17 00:00:00 2001 From: "zilong.dai" <2840478265@qq.com> Date: Tue, 15 Oct 2024 18:30:04 +0800 Subject: [PATCH] rm OP_CHECKGROTH16VERIFY mode 0 --- src/script/interpreter.cpp | 10 ++-------- src/script/script.cpp | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp index 67c99c71ff6..c3fa9013253 100644 --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -1043,8 +1043,8 @@ bool EvalScript(vector >& stack, const CScript& script, un return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION); } - // Only modes 0 and 1 are implemented; others return an error - if(mode.getint() != 1 && mode.getint() != 0){ + // Only modes 1 is implemented; Mode 0 is deprecated; others return an error + if(mode.getint() != 1){ // TODO: Implement mode 2 and 3 return set_error(serror, SCRIPT_ERR_SIG_DER); } @@ -1056,12 +1056,6 @@ bool EvalScript(vector >& stack, const CScript& script, un valtype& verfierDataB = stacktop(-6); valtype& verfierDataA = stacktop(-7); - /* TODO: drop the proof? - // Drop the signature in pre-segwit scripts but not segwit scripts - if (sigversion == SIGVERSION_BASE) { - scriptCode.FindAndDelete(CScript(vchSig)); - } - */ valtype publicInput1(32); // Initialize a 32-byte array for tx_hash if(mode.getint()==1){ CScript scriptCode(pbegincodehash, pend); diff --git a/src/script/script.cpp b/src/script/script.cpp index 817b46fda9f..ff43a686fd1 100644 --- a/src/script/script.cpp +++ b/src/script/script.cpp @@ -133,7 +133,7 @@ const char* GetOpName(opcodetype opcode) case OP_NOP1 : return "OP_NOP1"; case OP_CHECKLOCKTIMEVERIFY : return "OP_CHECKLOCKTIMEVERIFY"; case OP_CHECKSEQUENCEVERIFY : return "OP_CHECKSEQUENCEVERIFY"; - case OP_CHECKGROTH16VERIFY : return "OP_CHECKGROTH16VERIFY"; + case OP_CHECKGROTH16VERIFY : return "OP_CHECKGROTH16VERIFY"; case OP_NOP5 : return "OP_NOP5"; case OP_NOP6 : return "OP_NOP6"; case OP_NOP7 : return "OP_NOP7";