diff --git a/src/script/script.cpp b/src/script/script.cpp index e6312e1903..a6e68e3ed1 100644 --- a/src/script/script.cpp +++ b/src/script/script.cpp @@ -411,8 +411,10 @@ bool GetScriptOp(CScriptBase::const_iterator& pc, CScriptBase::const_iterator en bool IsOpSuccess(const opcodetype& opcode) { - return opcode == 80 || opcode == 98 || (opcode >= 126 && opcode <= 129) || - (opcode >= 131 && opcode <= 134) || (opcode >= 137 && opcode <= 138) || - (opcode >= 141 && opcode <= 142) || (opcode >= 149 && opcode <= 153) || - (opcode >= 187 && opcode <= 254); + // ELEMENTS: Don't mark opcodes (OP_CAT, OP_SUBSTR, OP_LEFT, OP_RIGHT) as OP_SUCCESS + return opcode == 80 || opcode == 98 || (opcode >= 137 && opcode <= 138) || + // ELEMENTS: Don't mark OP_INVERT , OP_AND, OP_OR, OP_XOR. OP_LSHIFT, OP_RSHIFT as success + (opcode >= 141 && opcode <= 142) || (opcode >= 149 && opcode <= 151) || + // ELEMENTS: Exclude OP_DETERMINISTICRANDOM, OP_CHECKSIGFROMSTACK(VERIFY), OP_SUBSTRLAZY + (opcode >= 187 && opcode <= 191) || (opcode >= 196 && opcode <= 254); } diff --git a/test/functional/test_framework/script.py b/test/functional/test_framework/script.py index 0da4daf681..fc562e004e 100644 --- a/test/functional/test_framework/script.py +++ b/test/functional/test_framework/script.py @@ -916,4 +916,4 @@ def taproot_construct(pubkey, scripts=None): return TaprootInfo(CScript([OP_1, tweaked]), pubkey, negated + 0, tweak, leaves) def is_op_success(o): - return o == 0x50 or o == 0x62 or o == 0x89 or o == 0x8a or o == 0x8d or o == 0x8e or (o >= 0x7e and o <= 0x81) or (o >= 0x83 and o <= 0x86) or (o >= 0x95 and o <= 0x99) or (o >= 0xbb and o <= 0xfe) + return o == 80 or o == 98 or (o >= 137 and o <= 138) or (o >= 141 and o <= 142) or (o >= 149 and o <= 151) or (o >= 187 and o <= 191) or (o >= 196 and o <= 254)