Merge pull request #3025 from mempool/mononaut/offline-loading-blocks

Handling for network interruptions in scrollable blockchain
This commit is contained in:
softsimon
2023-02-24 17:32:27 +04:00
committed by GitHub
7 changed files with 41 additions and 11 deletions

View File

@@ -62,7 +62,12 @@ export class CacheService {
for (let i = 0; i < chunkSize; i++) {
this.blockLoading[maxHeight - i] = true;
}
const result = await firstValueFrom(this.apiService.getBlocks$(maxHeight));
let result;
try {
result = await firstValueFrom(this.apiService.getBlocks$(maxHeight));
} catch (e) {
console.log("failed to load blocks: ", e.message);
}
for (let i = 0; i < chunkSize; i++) {
delete this.blockLoading[maxHeight - i];
}