From 516fa10a822f7cd5e31c25dad2591b9f015d7353 Mon Sep 17 00:00:00 2001 From: statefull Date: Fri, 3 Jan 2014 00:46:00 +0100 Subject: [PATCH] Updated lib/util.js In addressToPubKeyHash decoding a base58 address (bitcoin address) returns a byte array but twoSha256, concretely, sha256 requires a string or a buffer, so, to avoid errors performing sha256, the returned byte array is converted to a buffer. --- lib/util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util.js b/lib/util.js index 1610d2b..4811c43 100644 --- a/lib/util.js +++ b/lib/util.js @@ -170,7 +170,7 @@ var addressToPubKeyHash = exports.addressToPubKeyHash = function (address) { } // Decode - var buffer = decodeBase58(address); + var buffer = new Buffer(decodeBase58(address)); // Parse var parser = Binary.parse(buffer);