Skip to content

Commit

Permalink
fix(core-blockchain): only shift milestoneHeights[] if at that height (
Browse files Browse the repository at this point in the history
…#2904)

The previous code would remove entires from milestoneHeights[] even if
no milestone is hit (due to e.g. "currentTransactionsCount >= 150" being
true).
  • Loading branch information
vasild authored and faustbrian committed Sep 4, 2019
1 parent 33d8ba7 commit 56ff979
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/core-blockchain/src/blockchain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,9 @@ export class Blockchain implements blockchain.IBlockchain {
this.queue.push({ blocks: currentBlocksChunk });
currentBlocksChunk = [];
currentTransactionsCount = 0;
milestoneHeights.shift();
if (nextMilestone) {
milestoneHeights.shift();
}
}
}
this.queue.push({ blocks: currentBlocksChunk });
Expand Down

0 comments on commit 56ff979

Please sign in to comment.