Merge pull request #79 from matiu/features/package-improvements

Features/package improvements
This commit is contained in:
Matias Alejo Garcia 2014-05-17 13:12:52 -03:00
commit 667c605e6d
3 changed files with 6 additions and 3 deletions

View File

@ -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];

View File

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

View File

@ -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"
},