From f62875efada3bc194afb809bbcac32484b5b7940 Mon Sep 17 00:00:00 2001 From: "Ryan X. Charles" Date: Mon, 6 Jan 2014 14:52:23 -0500 Subject: [PATCH 1/2] negative indexes don't work in javascript --- Script.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Script.js b/Script.js index 4c2aa49..dc76edf 100644 --- a/Script.js +++ b/Script.js @@ -118,8 +118,8 @@ function spec(b) { { return (this.chunks.length > 3 && isSmallIntOp(this.chunks[0]) && - isSmallIntOp(this.chunks[-2]) && - this.chunks[-1] == OP_CHECKMULTISIG); + isSmallIntOp(this.chunks[this.chunks.length-2]) && + this.chunks[this.chunks.length-1] == OP_CHECKMULTISIG); }; // is this a script form we know? From 94aaa6d24258871852bc8e7ce360864a0db937b3 Mon Sep 17 00:00:00 2001 From: "Ryan X. Charles" Date: Mon, 6 Jan 2014 15:25:12 -0500 Subject: [PATCH 2/2] must use new operator to make new Put --- Script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Script.js b/Script.js index dc76edf..4e89d9e 100644 --- a/Script.js +++ b/Script.js @@ -443,7 +443,7 @@ function spec(b) { }; Script.chunksToBuffer = function (chunks) { - var buf = Put(); + var buf = new Put(); for (var i = 0, l = chunks.length; i < l; i++) { var data = chunks[i]; if (Buffer.isBuffer(data)) {