Merge pull request #79 from matiu/features/package-improvements
Features/package improvements
This commit is contained in:
commit
667c605e6d
|
@ -14,6 +14,7 @@ var Sync = require('./Sync');
|
||||||
var sockets = require('../app/controllers/socket.js');
|
var sockets = require('../app/controllers/socket.js');
|
||||||
var BlockExtractor = require('./BlockExtractor.js');
|
var BlockExtractor = require('./BlockExtractor.js');
|
||||||
var buffertools = require('buffertools');
|
var buffertools = require('buffertools');
|
||||||
|
var Address = bitcore.Address;
|
||||||
|
|
||||||
// var bitcoreUtil = require('bitcore/util/util');
|
// var bitcoreUtil = require('bitcore/util/util');
|
||||||
// var Deserialize = require('bitcore/Deserialize');
|
// var Deserialize = require('bitcore/Deserialize');
|
||||||
|
@ -158,8 +159,8 @@ HistoricSync.prototype.getBlockFromFile = function(cb) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var s = new Script(o.s);
|
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
|
// support only for p2pubkey p2pubkeyhash and p2sh
|
||||||
if (addrs.length === 1) {
|
if (addrs.length === 1) {
|
||||||
objTx.out[to].addrStr = addrs[0];
|
objTx.out[to].addrStr = addrs[0];
|
||||||
|
|
|
@ -30,6 +30,7 @@ Rpc._parseTxResult = function(info) {
|
||||||
// Outputs => add total
|
// Outputs => add total
|
||||||
var valueOutSat = 0;
|
var valueOutSat = 0;
|
||||||
info.vout.forEach( function(o) {
|
info.vout.forEach( function(o) {
|
||||||
|
o.value = o.value.toFixed(8);
|
||||||
valueOutSat += o.value * bitcore.util.COIN;
|
valueOutSat += o.value * bitcore.util.COIN;
|
||||||
delete o.scriptPubKey.hex;
|
delete o.scriptPubKey.hex;
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "insight-bitcore-api",
|
"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.",
|
"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": {
|
"author": {
|
||||||
"name": "Ryan X Charles",
|
"name": "Ryan X Charles",
|
||||||
"email": "ryan@bitpay.com"
|
"email": "ryan@bitpay.com"
|
||||||
|
@ -46,6 +46,7 @@
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "*"
|
"node": "*"
|
||||||
},
|
},
|
||||||
|
"bin": "insight.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node node_modules/grunt-cli/bin/grunt"
|
"start": "node node_modules/grunt-cli/bin/grunt"
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue