no longer need to reverse
This commit is contained in:
parent
bc4672760c
commit
3d713224bf
@ -105,13 +105,11 @@ BlockController.prototype.list = function(req, res) {
|
|||||||
var more = false;
|
var more = false;
|
||||||
var moreTs = lte;
|
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) {
|
if(err) {
|
||||||
return common.handleErrors(err, res);
|
return common.handleErrors(err, res);
|
||||||
}
|
}
|
||||||
|
|
||||||
hashes.reverse();
|
|
||||||
|
|
||||||
if(hashes.length > limit) {
|
if(hashes.length > limit) {
|
||||||
more = true;
|
more = true;
|
||||||
hashes = hashes.slice(0, limit);
|
hashes = hashes.slice(0, limit);
|
||||||
|
|||||||
@ -140,8 +140,8 @@ describe('Blocks', function() {
|
|||||||
stub.onSecondCall().callsArgWith(1, null, bitcore.Block.fromBuffer(blocks['00000000000006bd8fe9e53780323c0e85719eca771022e1eb6d10c62195c441'], 'hex'))
|
stub.onSecondCall().callsArgWith(1, null, bitcore.Block.fromBuffer(blocks['00000000000006bd8fe9e53780323c0e85719eca771022e1eb6d10c62195c441'], 'hex'))
|
||||||
|
|
||||||
var hashes = [
|
var hashes = [
|
||||||
'00000000000006bd8fe9e53780323c0e85719eca771022e1eb6d10c62195c441',
|
'000000000008fbb2e358e382a6f6948b2da24563bba183af447e6e2542e8efc7',
|
||||||
'000000000008fbb2e358e382a6f6948b2da24563bba183af447e6e2542e8efc7'
|
'00000000000006bd8fe9e53780323c0e85719eca771022e1eb6d10c62195c441'
|
||||||
];
|
];
|
||||||
var node = {
|
var node = {
|
||||||
getBlock: stub,
|
getBlock: stub,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user