mirror of
https://github.com/mempool/mempool.git
synced 2024-11-20 02:11:49 +01:00
Merge pull request #1912 from mempool/nymkappa/bugfix/dont-preload-genesis
Don't preload /block APIs for genesis block
This commit is contained in:
commit
9991d43b3b
@ -155,13 +155,15 @@ export class BlockComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
}),
|
||||
tap((block: BlockExtended) => {
|
||||
// Preload previous block summary (execute the http query so the response will be cached)
|
||||
this.unsubscribeNextBlockSubscriptions();
|
||||
setTimeout(() => {
|
||||
this.nextBlockSubscription = this.apiService.getBlock$(block.previousblockhash).subscribe();
|
||||
this.nextBlockTxListSubscription = this.electrsApiService.getBlockTransactions$(block.previousblockhash).subscribe();
|
||||
this.nextBlockSummarySubscription = this.apiService.getStrippedBlockTransactions$(block.previousblockhash).subscribe();
|
||||
}, 100);
|
||||
if (block.height > 0) {
|
||||
// Preload previous block summary (execute the http query so the response will be cached)
|
||||
this.unsubscribeNextBlockSubscriptions();
|
||||
setTimeout(() => {
|
||||
this.nextBlockSubscription = this.apiService.getBlock$(block.previousblockhash).subscribe();
|
||||
this.nextBlockTxListSubscription = this.electrsApiService.getBlockTransactions$(block.previousblockhash).subscribe();
|
||||
this.nextBlockSummarySubscription = this.apiService.getStrippedBlockTransactions$(block.previousblockhash).subscribe();
|
||||
}, 100);
|
||||
}
|
||||
|
||||
this.block = block;
|
||||
this.blockHeight = block.height;
|
||||
|
Loading…
Reference in New Issue
Block a user