Browse Source

don't try to find blocks with heights less than zero

fix-133-memory-crash
Dan Janosik 7 years ago
parent
commit
9ecaa79933
  1. 8
      routes/baseActionsRouter.js

8
routes/baseActionsRouter.js

@ -196,11 +196,15 @@ router.get("/blocks", function(req, res) {
var blockHeights = [];
if (sort == "desc") {
for (var i = (getblockchaininfo.blocks - offset); i > (getblockchaininfo.blocks - offset - limit); i--) {
blockHeights.push(i);
if (i >= 0) {
blockHeights.push(i);
}
}
} else {
for (var i = offset; i < (offset + limit); i++) {
blockHeights.push(i);
if (i >= 0) {
blockHeights.push(i);
}
}
}

Loading…
Cancel
Save