Fix for block transition when switching networks.

This commit is contained in:
softsimon 2020-07-22 20:09:02 +07:00
parent 0f611ecf8a
commit 251b8cdd8d
No known key found for this signature in database
GPG Key ID: 488D7DCFB5A430D7

View File

@ -46,6 +46,12 @@ export class BlockchainBlocksComponent implements OnInit, OnDestroy {
if (this.blocks.some((b) => b.height === block.height)) {
return;
}
if (this.blocks.length && block.height !== this.blocks[0].height + 1) {
this.blocks = [];
this.blocksFilled = false;
}
this.blocks.unshift(block);
this.blocks = this.blocks.slice(0, 8);