Fixed ordering of txs.
This commit is contained in:
parent
b9b819691a
commit
9a1f1db523
@ -76,15 +76,15 @@ AddressService.prototype.getAddressHistory = function(addresses, options, callba
|
|||||||
return callback(err);
|
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) {
|
self._getAddressTxHistory(options, function(err, txList) {
|
||||||
|
|
||||||
if (err) {
|
if (err) {
|
||||||
return callback(err);
|
return callback(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
txList = utils.orderByConfirmations(txList);
|
|
||||||
|
|
||||||
var results = {
|
var results = {
|
||||||
totalCount: options.txIdList.length || 0,
|
totalCount: options.txIdList.length || 0,
|
||||||
items: txList
|
items: txList
|
||||||
@ -397,7 +397,7 @@ AddressService.prototype._getAddressTxHistory = function(options, callback) {
|
|||||||
// go and get the actual txs
|
// go and get the actual txs
|
||||||
async.mapLimit(ids, 4, function(id, next) {
|
async.mapLimit(ids, 4, function(id, next) {
|
||||||
|
|
||||||
if (id.height === -1) {
|
if (id.height === 0xffffffff) {
|
||||||
return self._mempool.getMempoolTransaction(id.txid, function(err, tx) {
|
return self._mempool.getMempoolTransaction(id.txid, function(err, tx) {
|
||||||
|
|
||||||
if (err || !tx) {
|
if (err || !tx) {
|
||||||
|
|||||||
@ -278,7 +278,7 @@ MempoolService.prototype.getTxidsByAddress = function(address, type, callback) {
|
|||||||
type = 0;
|
type = 0;
|
||||||
}
|
}
|
||||||
if (type === 'both' || type === addressInfo.input) {
|
if (type === 'both' || type === addressInfo.input) {
|
||||||
results.push({ txid: addressInfo.txid, height: -1 });
|
results.push({ txid: addressInfo.txid, height: 0xffffffff });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user