Fix for kept block amount when cache already contains more.

This commit is contained in:
softsimon 2020-11-02 21:28:40 +07:00
parent e8a99e7eef
commit 70c01c017d

View File

@ -93,7 +93,7 @@ class Blocks {
this.blocks.push(block); this.blocks.push(block);
if (this.blocks.length > Blocks.KEEP_BLOCK_AMOUNT) { if (this.blocks.length > Blocks.KEEP_BLOCK_AMOUNT) {
this.blocks.shift(); this.blocks = this.blocks.slice(-Blocks.KEEP_BLOCK_AMOUNT);
} }
if (this.newBlockCallbacks.length) { if (this.newBlockCallbacks.length) {