Merge pull request #55 from periodic1236/master
Sort block list by height
This commit is contained in:
commit
d6c21026c2
|
@ -139,6 +139,14 @@ exports.list = function(req, res) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}, function(err, allblocks) {
|
}, function(err, allblocks) {
|
||||||
|
// sort blocks by height
|
||||||
|
allblocks.sort(
|
||||||
|
function compare(a,b) {
|
||||||
|
if (a.height < b.height) return 1;
|
||||||
|
if (a.height > b.height) return -1;
|
||||||
|
return 0;
|
||||||
|
});
|
||||||
|
|
||||||
res.jsonp({
|
res.jsonp({
|
||||||
blocks: allblocks,
|
blocks: allblocks,
|
||||||
length: allblocks.length,
|
length: allblocks.length,
|
||||||
|
|
Loading…
Reference in New Issue