From c5338eb2a83c6e2ff4f9eaaa20dba632b8283660 Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Sat, 17 May 2014 00:21:21 -0300 Subject: [PATCH 1/3] fix sci notation --- lib/Rpc.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Rpc.js b/lib/Rpc.js index 47ce37a6..9f78c8d3 100644 --- a/lib/Rpc.js +++ b/lib/Rpc.js @@ -30,6 +30,7 @@ Rpc._parseTxResult = function(info) { // Outputs => add total var valueOutSat = 0; info.vout.forEach( function(o) { + o.value = o.value.toFixed(8); valueOutSat += o.value * bitcore.util.COIN; delete o.scriptPubKey.hex; }); From 39197278abc7cec29e8373af9388bf2c223bdad9 Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Sat, 17 May 2014 12:54:58 -0300 Subject: [PATCH 2/3] mv bin to .bin --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 906b2815..7b56ceb0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "insight-bitcore-api", "description": "An open-source bitcoin blockchain API. The Insight API provides you with a convenient, powerful and simple way to query and broadcast data on the bitcoin network and build your own services with it.", - "version": "0.1.10", + "version": "0.1.11", "author": { "name": "Ryan X Charles", "email": "ryan@bitpay.com" @@ -46,6 +46,7 @@ "engines": { "node": "*" }, + "bin": "insight.js", "scripts": { "start": "node node_modules/grunt-cli/bin/grunt" }, From 00b2abd2ac22c3f637e1a155504aefcfe4c688bd Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Sat, 17 May 2014 13:07:50 -0300 Subject: [PATCH 3/3] fix get getAddr to new bitcore --- lib/HistoricSync.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/HistoricSync.js b/lib/HistoricSync.js index 1229305c..07196566 100644 --- a/lib/HistoricSync.js +++ b/lib/HistoricSync.js @@ -14,6 +14,7 @@ var Sync = require('./Sync'); var sockets = require('../app/controllers/socket.js'); var BlockExtractor = require('./BlockExtractor.js'); var buffertools = require('buffertools'); +var Address = bitcore.Address; // var bitcoreUtil = require('bitcore/util/util'); // var Deserialize = require('bitcore/Deserialize'); @@ -158,8 +159,8 @@ HistoricSync.prototype.getBlockFromFile = function(cb) { try { var s = new Script(o.s); - var addrs = self.sync.txDb.getAddrStr(s); - + var addrs = new Address.fromScriptPubKey(s, config.network); + // support only for p2pubkey p2pubkeyhash and p2sh if (addrs.length === 1) { objTx.out[to].addrStr = addrs[0];