better ordering of txs

This commit is contained in:
Matias Alejo Garcia 2015-07-17 16:52:03 -03:00
parent d98757125e
commit 270599597e

View File

@ -143,7 +143,11 @@ exports.multitxs = function(req, res, next) {
if (to > nbTxs) to = nbTxs; if (to > nbTxs) to = nbTxs;
txs.sort(function(a, b) { txs.sort(function(a, b) {
return (b.firstSeenTs || b.ts) - (a.firstSeenTs || a.ts); var b = (b.firstSeenTs || b.ts)+ b.txid;
var a = (a.firstSeenTs || a.ts)+ a.txid;
if (a > b) return -1;
if (a < b) return 1;
return 0;
}); });
txs = txs.slice(from, to); txs = txs.slice(from, to);