Merge branch 'master' of github.com:kleetus/bitcore-node

This commit is contained in:
Chris Kleeschulte 2017-11-08 19:04:10 -05:00
commit b138a558ae
No known key found for this signature in database
GPG Key ID: 33195D27EF6BDB7F
3 changed files with 7 additions and 5 deletions

View File

@ -50,7 +50,6 @@ AddressService.dependencies = [
// in are [addr1, addr2, addr3], then if addr3 has tx1 at height 10, addr2 has tx2 at height 9 and tx1 has no txs, // in are [addr1, addr2, addr3], then if addr3 has tx1 at height 10, addr2 has tx2 at height 9 and tx1 has no txs,
// then I would pass back [tx1, tx2] in that order // then I would pass back [tx1, tx2] in that order
AddressService.prototype.getAddressHistory = function(addresses, options, callback) { AddressService.prototype.getAddressHistory = function(addresses, options, callback) {
var self = this; var self = this;
options = options || {}; options = options || {};
@ -435,6 +434,8 @@ AddressService.prototype._getAddressTxidHistory = function(address, options, cal
options.start = options.start || 0; options.start = options.start || 0;
options.end = options.end || 0xffffffff; options.end = options.end || 0xffffffff;
var results = [];
options.endHeightBuf = new Buffer(4); options.endHeightBuf = new Buffer(4);
options.endHeightBuf.writeUInt32BE(options.end); options.endHeightBuf.writeUInt32BE(options.end);
@ -461,7 +462,7 @@ AddressService.prototype._getAddressTxidHistory = function(address, options, cal
return next(); return next();
} }
options.txIdList = mempoolTxids; results = mempoolTxids;
next(); next();
}, },
// stream the rest of the confirmed txids out of the address index // stream the rest of the confirmed txids out of the address index
@ -480,12 +481,13 @@ AddressService.prototype._getAddressTxidHistory = function(address, options, cal
}); });
txIdTransformStream.on('end', function() { txIdTransformStream.on('end', function() {
options.txIdList = options.txIdList.concat(results);
next(); next();
}); });
txIdTransformStream._transform = function(chunk, enc, callback) { txIdTransformStream._transform = function(chunk, enc, callback) {
var txInfo = self._encoding.decodeAddressIndexKey(chunk); var txInfo = self._encoding.decodeAddressIndexKey(chunk);
options.txIdList.push({ txid: txInfo.txid, height: txInfo.height }); results.push({ txid: txInfo.txid, height: txInfo.height });
callback(); callback();
}; };

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "bitcore-node", "name": "bitcore-node",
"version": "5.0.0-beta.37", "version": "5.0.0-beta.39",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@ -5,7 +5,7 @@
"node": ">=8.0.0" "node": ">=8.0.0"
}, },
"author": "BitPay <dev@bitpay.com>", "author": "BitPay <dev@bitpay.com>",
"version": "5.0.0-beta.37", "version": "5.0.0-beta.39",
"main": "./index.js", "main": "./index.js",
"repository": "git://github.com/bitpay/bitcore-node.git", "repository": "git://github.com/bitpay/bitcore-node.git",
"homepage": "https://github.com/bitpay/bitcore-node", "homepage": "https://github.com/bitpay/bitcore-node",