add paginated virtual scrolling to blockchain blocks bar

This commit is contained in:
Mononaut
2022-12-27 05:28:57 -06:00
parent 7478acb445
commit b35fbbbbd9
11 changed files with 355 additions and 80 deletions

View File

@@ -677,7 +677,12 @@ class Blocks {
}
public async $getBlocks(fromHeight?: number, limit: number = 15): Promise<BlockExtended[]> {
let currentHeight = fromHeight !== undefined ? fromHeight : this.currentBlockHeight;
if (currentHeight > this.currentBlockHeight) {
limit -= currentHeight - this.currentBlockHeight;
currentHeight = this.currentBlockHeight;
}
const returnBlocks: BlockExtended[] = [];
if (currentHeight < 0) {