Fixed ordering of txs.

This commit is contained in:
Chris Kleeschulte 2017-11-07 15:36:38 -05:00
parent b9b819691a
commit 9a1f1db523
No known key found for this signature in database
GPG Key ID: 33195D27EF6BDB7F
2 changed files with 5 additions and 5 deletions

View File

@ -76,15 +76,15 @@ AddressService.prototype.getAddressHistory = function(addresses, options, callba
return callback(err);
}
options.txIdList = lodash.uniqWith(lodash.flattenDeep(options.txIdList), lodash.isEqual);
options.txIdList = lodash.uniqWith(options.txIdList, lodash.isEqual);
options.txIdList = lodash.orderBy(options.txIdList, ['height'], ['desc']);
self._getAddressTxHistory(options, function(err, txList) {
if (err) {
return callback(err);
}
txList = utils.orderByConfirmations(txList);
var results = {
totalCount: options.txIdList.length || 0,
items: txList
@ -397,7 +397,7 @@ AddressService.prototype._getAddressTxHistory = function(options, callback) {
// go and get the actual txs
async.mapLimit(ids, 4, function(id, next) {
if (id.height === -1) {
if (id.height === 0xffffffff) {
return self._mempool.getMempoolTransaction(id.txid, function(err, tx) {
if (err || !tx) {

View File

@ -278,7 +278,7 @@ MempoolService.prototype.getTxidsByAddress = function(address, type, callback) {
type = 0;
}
if (type === 'both' || type === addressInfo.input) {
results.push({ txid: addressInfo.txid, height: -1 });
results.push({ txid: addressInfo.txid, height: 0xffffffff });
}
});