From af132c88182ff65eb448ca48bd7f83c44622d518 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Thu, 24 Aug 2017 18:22:45 -0700 Subject: [PATCH] opcode: handle OP_1NEGATE in opcode.toNum. --- lib/script/opcode.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/script/opcode.js b/lib/script/opcode.js index 246dd980..8c15e246 100644 --- a/lib/script/opcode.js +++ b/lib/script/opcode.js @@ -207,6 +207,9 @@ Opcode.prototype.toSmall = function toSmall() { */ Opcode.prototype.toNum = function toNum(minimal, limit) { + if (this.value === opcodes.OP_1NEGATE) + return ScriptNum.fromInt(-1); + const smi = this.toSmall(); if (smi !== -1)