script: fix minimalif.

This commit is contained in:
Christopher Jeffrey 2016-09-30 23:44:54 -07:00
parent d4778d21b2
commit 77e1af4faf
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -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;
}