Skip to content
Snippets Groups Projects
Commit 21709dea authored by Cédric Moreau's avatar Cédric Moreau
Browse files

Fix #506 Last block issuer is not counted under /blockchain/difficulties

parent 82a8a0e1
Branches
Tags
No related merge requests found
...@@ -837,7 +837,7 @@ function FileDAL(params) { ...@@ -837,7 +837,7 @@ function FileDAL(params) {
this.getUniqueIssuersBetween = (start, end) => co(function *() { this.getUniqueIssuersBetween = (start, end) => co(function *() {
const current = yield that.blockDAL.getCurrent(); const current = yield that.blockDAL.getCurrent();
const firstBlock = Math.max(0, start); const firstBlock = Math.max(0, start);
const lastBlock = Math.max(0, Math.min(current.number - 1, end)); const lastBlock = Math.max(0, Math.min(current.number, end));
const blocks = yield that.blockDAL.getBlocks(firstBlock, lastBlock); const blocks = yield that.blockDAL.getBlocks(firstBlock, lastBlock);
return _.chain(blocks).pluck('issuer').uniq().value(); return _.chain(blocks).pluck('issuer').uniq().value();
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment