no longer need to reverse

This commit is contained in:
Patrick Nagurny 2015-09-15 18:23:27 -04:00
parent bc4672760c
commit 3d713224bf
2 changed files with 3 additions and 5 deletions

View File

@ -105,13 +105,11 @@ BlockController.prototype.list = function(req, res) {
var more = false;
var moreTs = lte;
self.node.services.db.getBlockHashesByTimestamp(gte, lte, function(err, hashes) {
self.node.services.db.getBlockHashesByTimestamp(lte, gte, function(err, hashes) {
if(err) {
return common.handleErrors(err, res);
}
hashes.reverse();
if(hashes.length > limit) {
more = true;
hashes = hashes.slice(0, limit);

View File

@ -140,8 +140,8 @@ describe('Blocks', function() {
stub.onSecondCall().callsArgWith(1, null, bitcore.Block.fromBuffer(blocks['00000000000006bd8fe9e53780323c0e85719eca771022e1eb6d10c62195c441'], 'hex'))
var hashes = [
'00000000000006bd8fe9e53780323c0e85719eca771022e1eb6d10c62195c441',
'000000000008fbb2e358e382a6f6948b2da24563bba183af447e6e2542e8efc7'
'000000000008fbb2e358e382a6f6948b2da24563bba183af447e6e2542e8efc7',
'00000000000006bd8fe9e53780323c0e85719eca771022e1eb6d10c62195c441'
];
var node = {
getBlock: stub,