Merge pull request #417 from matiu/bug/tx-sort

fix sort 2
This commit is contained in:
Matias Alejo Garcia 2015-10-28 22:13:23 -03:00
commit fa6555b16c

View File

@ -144,8 +144,8 @@ exports.multitxs = function(req, res, next) {
var MAX = 9999999999;
txs.sort(function(a, b) {
var b = (b.bs || b.firstSeenTs || MAX) + b.txid;
var a = (a.bs || b.firstSeenTs || MAX) + a.txid;
var b = (b.ts || b.firstSeenTs || MAX) + b.txid;
var a = (a.ts || b.firstSeenTs || MAX) + a.txid;
if (a > b) return -1;
if (a < b) return 1;
return 0;