From 6263d4023951ec1ae40b416e551446bcd273e1f9 Mon Sep 17 00:00:00 2001 From: Scott Sadler Date: Sun, 18 Feb 2018 20:38:29 -0300 Subject: [PATCH] guard cryptoconditions --- src/script/interpreter.cpp | 5 ++++- src/script/standard.cpp | 13 ++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp index 94727cbca..f203ccf85 100644 --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -940,7 +940,9 @@ bool EvalScript(vector >& stack, const CScript& script, un case OP_CHECKCRYPTOCONDITION: case OP_CHECKCRYPTOCONDITIONVERIFY: { - // (fulfillment condition -- bool) + if (!IsCryptoConditionsEnabled()) { + goto INTERPRETER_DEFAULT; + } if (stack.size() < 2) return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION); @@ -982,6 +984,7 @@ bool EvalScript(vector >& stack, const CScript& script, un } break; +INTERPRETER_DEFAULT: default: return set_error(serror, SCRIPT_ERR_BAD_OPCODE); } diff --git a/src/script/standard.cpp b/src/script/standard.cpp index 4dadaff56..308f4e085 100644 --- a/src/script/standard.cpp +++ b/src/script/standard.cpp @@ -9,6 +9,7 @@ #include "script/script.h" #include "util.h" #include "utilstrencodings.h" +#include "komodo_cryptoconditions.h" #include @@ -68,11 +69,13 @@ bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, vector