fix regtests
This commit is contained in:
parent
c65c2bad20
commit
dae5c9d3d5
@ -80,18 +80,18 @@ AddressHistory.prototype.get = function(callback) {
|
|||||||
return callback(new TypeError('Maximum number of addresses (' + this.maxAddressesQuery + ') exceeded'));
|
return callback(new TypeError('Maximum number of addresses (' + this.maxAddressesQuery + ') exceeded'));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.options.noBalance = true;
|
var opts = _.clone(this.options);
|
||||||
|
opts.noBalance = true;
|
||||||
|
|
||||||
if (this.addresses.length === 1) {
|
if (this.addresses.length === 1) {
|
||||||
var address = this.addresses[0];
|
var address = this.addresses[0];
|
||||||
self.node.services.address.getAddressSummary(address, this.options, function(err, summary) {
|
self.node.services.address.getAddressSummary(address, opts, function(err, summary) {
|
||||||
if (err) {
|
if (err) {
|
||||||
return callback(err);
|
return callback(err);
|
||||||
}
|
}
|
||||||
return self._paginateWithDetails.call(self, summary.txids, callback);
|
return self._paginateWithDetails.call(self, summary.txids, callback);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
var opts = _.clone(this.options);
|
|
||||||
|
|
||||||
opts.fullTxList = true;
|
opts.fullTxList = true;
|
||||||
async.mapLimit(
|
async.mapLimit(
|
||||||
|
|||||||
@ -1447,12 +1447,13 @@ AddressService.prototype._getAddressConfirmedOutputsSummary = function(address,
|
|||||||
|
|
||||||
var txid = output.txid;
|
var txid = output.txid;
|
||||||
var outputIndex = output.outputIndex;
|
var outputIndex = output.outputIndex;
|
||||||
|
result.totalReceived += output.satoshis;
|
||||||
|
result.appearanceIds[txid] = output.height;
|
||||||
|
|
||||||
if (!options.noBalance) {
|
if (!options.noBalance) {
|
||||||
|
|
||||||
// Bitcoind's isSpent only works for confirmed transactions
|
// Bitcoind's isSpent only works for confirmed transactions
|
||||||
var spentDB = self.node.services.bitcoind.isSpent(txid, outputIndex);
|
var spentDB = self.node.services.bitcoind.isSpent(txid, outputIndex);
|
||||||
result.totalReceived += output.satoshis;
|
|
||||||
result.appearanceIds[txid] = output.height;
|
|
||||||
|
|
||||||
if (!spentDB) {
|
if (!spentDB) {
|
||||||
result.balance += output.satoshis;
|
result.balance += output.satoshis;
|
||||||
@ -1546,12 +1547,12 @@ AddressService.prototype._getAddressMempoolSummary = function(address, options,
|
|||||||
if (err) {
|
if (err) {
|
||||||
return next(err);
|
return next(err);
|
||||||
}
|
}
|
||||||
if (!options.noBalance) {
|
for (var i = 0; i < mempoolOutputs.length; i++) {
|
||||||
for (var i = 0; i < mempoolOutputs.length; i++) {
|
var output = mempoolOutputs[i];
|
||||||
var output = mempoolOutputs[i];
|
|
||||||
|
|
||||||
result.unconfirmedAppearanceIds[output.txid] = output.timestamp;
|
result.unconfirmedAppearanceIds[output.txid] = output.timestamp;
|
||||||
|
|
||||||
|
if (!options.noBalance) {
|
||||||
var spentIndexSyncKey = encoding.encodeSpentIndexSyncKey(
|
var spentIndexSyncKey = encoding.encodeSpentIndexSyncKey(
|
||||||
new Buffer(output.txid, 'hex'), // TODO: get buffer directly
|
new Buffer(output.txid, 'hex'), // TODO: get buffer directly
|
||||||
output.outputIndex
|
output.outputIndex
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user