add missing updates
This commit is contained in:
parent
a8b39237ad
commit
c08ccc388f
@ -3,7 +3,7 @@
|
|||||||
// server-side socket behaviour
|
// server-side socket behaviour
|
||||||
// io is a variable already taken in express
|
// io is a variable already taken in express
|
||||||
var ios = null;
|
var ios = null;
|
||||||
var util = require('bitcore/util/util');
|
var util = require('bitcore').util;
|
||||||
|
|
||||||
module.exports.init = function(app, io_ext) {
|
module.exports.init = function(app, io_ext) {
|
||||||
ios = io_ext;
|
ios = io_ext;
|
||||||
|
|||||||
@ -6,7 +6,7 @@ var bitcore = require('bitcore');
|
|||||||
var BitcoreAddress = bitcore.Address;
|
var BitcoreAddress = bitcore.Address;
|
||||||
var BitcoreTransaction = bitcore.Transaction;
|
var BitcoreTransaction = bitcore.Transaction;
|
||||||
var BitcoreUtil = bitcore.util;
|
var BitcoreUtil = bitcore.util;
|
||||||
var Parser = bitcore.util.BinaryParser;
|
var Parser = bitcore.BinaryParser;
|
||||||
var Buffer = bitcore.Buffer;
|
var Buffer = bitcore.Buffer;
|
||||||
var TransactionDb = imports.TransactionDb || require('../../lib/TransactionDb').default();
|
var TransactionDb = imports.TransactionDb || require('../../lib/TransactionDb').default();
|
||||||
var CONCURRENCY = 5;
|
var CONCURRENCY = 5;
|
||||||
@ -134,7 +134,7 @@ Address.prototype.update = function(next, notxlist) {
|
|||||||
var v = txItem.value_sat;
|
var v = txItem.value_sat;
|
||||||
|
|
||||||
if ( !seen[txItem.txid] ) {
|
if ( !seen[txItem.txid] ) {
|
||||||
if (!notxlist) {
|
if (!notxlist) {
|
||||||
txs.push({txid: txItem.txid, ts: txItem.ts});
|
txs.push({txid: txItem.txid, ts: txItem.ts});
|
||||||
}
|
}
|
||||||
seen[txItem.txid]=1;
|
seen[txItem.txid]=1;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
var bitcore = require('bitcore'),
|
var bitcore = require('bitcore'),
|
||||||
Block = bitcore.Block,
|
Block = bitcore.Block,
|
||||||
networks = bitcore.networks,
|
networks = bitcore.networks,
|
||||||
Parser = bitcore.util.Parser,
|
Parser = bitcore.BinaryParser,
|
||||||
fs = require('fs'),
|
fs = require('fs'),
|
||||||
Buffer = bitcore.Buffer,
|
Buffer = bitcore.Buffer,
|
||||||
glob = require('glob'),
|
glob = require('glob'),
|
||||||
|
|||||||
@ -24,14 +24,15 @@ var MAX_OPEN_FILES = 500;
|
|||||||
/**
|
/**
|
||||||
* Module dependencies.
|
* Module dependencies.
|
||||||
*/
|
*/
|
||||||
var Rpc = imports.rpc || require('./Rpc'),
|
|
||||||
bitcore = require('bitcore'),
|
|
||||||
util = bitcore.util,
|
|
||||||
levelup = require('levelup'),
|
|
||||||
async = require('async'),
|
|
||||||
config = require('../config/config'),
|
|
||||||
assert = require('assert');
|
|
||||||
|
|
||||||
|
var bitcore = require('bitcore'),
|
||||||
|
Rpc = imports.rpc || require('./Rpc'),
|
||||||
|
util = bitcore.util,
|
||||||
|
networks = bitcore.networks,
|
||||||
|
levelup = require('levelup'),
|
||||||
|
async = require('async'),
|
||||||
|
config = require('../config/config'),
|
||||||
|
assert = require('assert');
|
||||||
|
|
||||||
var db = imports.db || levelup(config.leveldb + '/txs',{maxOpenFiles: MAX_OPEN_FILES} );
|
var db = imports.db || levelup(config.leveldb + '/txs',{maxOpenFiles: MAX_OPEN_FILES} );
|
||||||
var Script = bitcore.Script;
|
var Script = bitcore.Script;
|
||||||
@ -46,8 +47,6 @@ var versionedData= require('soop').load('bitcore/util/VersionedData',{
|
|||||||
var Address = require('soop').load('bitcore/lib/Address',{
|
var Address = require('soop').load('bitcore/lib/Address',{
|
||||||
parent: versionedData
|
parent: versionedData
|
||||||
});
|
});
|
||||||
var bitutil = bitcore.util.util;
|
|
||||||
var networks = bitcore.networks;
|
|
||||||
|
|
||||||
var TransactionDb = function() {
|
var TransactionDb = function() {
|
||||||
TransactionDb.super(this, arguments);
|
TransactionDb.super(this, arguments);
|
||||||
@ -290,7 +289,6 @@ TransactionDb.prototype.fromIdWithInfo = function(txid, cb) {
|
|||||||
TransactionDb.prototype.fromTxIdN = function(txid, n, confirmations, cb) {
|
TransactionDb.prototype.fromTxIdN = function(txid, n, confirmations, cb) {
|
||||||
var self = this;
|
var self = this;
|
||||||
var k = OUTS_PREFIX + txid + '-' + n;
|
var k = OUTS_PREFIX + txid + '-' + n;
|
||||||
505
|
|
||||||
|
|
||||||
db.get(k, function(err, val) {
|
db.get(k, function(err, val) {
|
||||||
if (!val || (err && err.notFound)) {
|
if (!val || (err && err.notFound)) {
|
||||||
@ -467,7 +465,7 @@ TransactionDb.prototype.getAddrStr = function(s) {
|
|||||||
switch (type) {
|
switch (type) {
|
||||||
case Script.TX_PUBKEY:
|
case Script.TX_PUBKEY:
|
||||||
var chunk = s.captureOne();
|
var chunk = s.captureOne();
|
||||||
addr = new Address(self.network.addressVersion, bitutil.sha256ripe160(chunk));
|
addr = new Address(self.network.addressVersion, bitcore.util.sha256ripe160(chunk));
|
||||||
addrStrs.push(addr.toString());
|
addrStrs.push(addr.toString());
|
||||||
break;
|
break;
|
||||||
case Script.TX_PUBKEYHASH:
|
case Script.TX_PUBKEYHASH:
|
||||||
@ -482,7 +480,7 @@ TransactionDb.prototype.getAddrStr = function(s) {
|
|||||||
var chunks = s.capture();
|
var chunks = s.capture();
|
||||||
chunks.forEach(function(chunk) {
|
chunks.forEach(function(chunk) {
|
||||||
if (chunk && Buffer.isBuffer(chunk)) {
|
if (chunk && Buffer.isBuffer(chunk)) {
|
||||||
var a = new Address(self.network.addressVersion, bitutil.sha256ripe160(chunk));
|
var a = new Address(self.network.addressVersion, bitcore.util.sha256ripe160(chunk));
|
||||||
addrStrs.push(a.toString());
|
addrStrs.push(a.toString());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user