From 77e1af4faf21c995ff4f0fbf4cd8a18e6ca58c4f Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Fri, 30 Sep 2016 23:44:54 -0700 Subject: [PATCH] script: fix minimalif. --- lib/script/script.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/script/script.js b/lib/script/script.js index ec9a0c38..2a22b088 100644 --- a/lib/script/script.js +++ b/lib/script/script.js @@ -367,7 +367,7 @@ Script.prototype.execute = function execute(stack, flags, tx, index, version) { if (stack.length < 1) throw new ScriptError('UNBALANCED_CONDITIONAL', op, ip); - val = Script.bool(stack.pop()); + val = stack.pop(); if (version == 1 && (flags & constants.flags.VERIFY_MINIMALIF)) { if (val.length > 1) @@ -377,6 +377,8 @@ Script.prototype.execute = function execute(stack, flags, tx, index, version) { throw new ScriptError('MINIMALIF'); } + val = Script.bool(val); + if (op === opcodes.OP_NOTIF) val = !val; }