opcode: handle OP_1NEGATE in opcode.toNum.

This commit is contained in:
Christopher Jeffrey 2017-08-24 18:22:45 -07:00
parent d6ce66bce9
commit af132c8818
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -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)