diff options
| author | Wladimir J. van der Laan <[email protected]> | 2016-09-27 16:54:23 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2016-09-27 17:10:15 +0200 |
| commit | 5a4f6d72e6154d21eb34fbbc8d7c099532569966 (patch) | |
| tree | da3536b7b6583537822e61fdec235eebe8d7b706 /src/script/interpreter.cpp | |
| parent | Merge #8357: [mempool] Fix relaypriority calculation error (diff) | |
| parent | Make non-minimal OP_IF/NOTIF argument non-standard for P2WSH (diff) | |
| download | discoin-5a4f6d72e6154d21eb34fbbc8d7c099532569966.tar.xz discoin-5a4f6d72e6154d21eb34fbbc8d7c099532569966.zip | |
Merge #8526: Make non-minimal OP_IF/NOTIF argument non-standard for P2WSH
c72c5b1 Make non-minimal OP_IF/NOTIF argument non-standard for P2WSH (Johnson Lau)
Diffstat (limited to 'src/script/interpreter.cpp')
| -rw-r--r-- | src/script/interpreter.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp index 47ea261e3..fd356fed0 100644 --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -428,6 +428,12 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, un if (stack.size() < 1) return set_error(serror, SCRIPT_ERR_UNBALANCED_CONDITIONAL); valtype& vch = stacktop(-1); + if (sigversion == SIGVERSION_WITNESS_V0 && (flags & SCRIPT_VERIFY_MINIMALIF)) { + if (vch.size() > 1) + return set_error(serror, SCRIPT_ERR_MINIMALIF); + if (vch.size() == 1 && vch[0] != 1) + return set_error(serror, SCRIPT_ERR_MINIMALIF); + } fValue = CastToBool(vch); if (opcode == OP_NOTIF) fValue = !fValue; |