parent
38d424f793
commit
fc7a5c2e28
@ -1,3 +1,8 @@
|
|||||||
|
|
||||||
|
<div class="text-center pb-1" *ngIf="network === '' && latestBlockHeight && latestBlockHeight < 630000">
|
||||||
|
<h3>Quantitative Hardening in {{ 630000 - latestBlockHeight }} blocks (~<app-timespan [time]="(630000 - latestBlockHeight) * 10 * 60"></app-timespan>)</h3>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="container-xl">
|
<div class="container-xl">
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
@ -4,6 +4,7 @@ import { StateService } from '../../services/state.service';
|
|||||||
import { Block } from '../../interfaces/electrs.interface';
|
import { Block } from '../../interfaces/electrs.interface';
|
||||||
import { Subscription } from 'rxjs';
|
import { Subscription } from 'rxjs';
|
||||||
import { SeoService } from 'src/app/services/seo.service';
|
import { SeoService } from 'src/app/services/seo.service';
|
||||||
|
import { environment } from 'src/environments/environment';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-latest-blocks',
|
selector: 'app-latest-blocks',
|
||||||
@ -11,11 +12,15 @@ import { SeoService } from 'src/app/services/seo.service';
|
|||||||
styleUrls: ['./latest-blocks.component.scss'],
|
styleUrls: ['./latest-blocks.component.scss'],
|
||||||
})
|
})
|
||||||
export class LatestBlocksComponent implements OnInit, OnDestroy {
|
export class LatestBlocksComponent implements OnInit, OnDestroy {
|
||||||
|
network = environment.network;
|
||||||
|
|
||||||
blocks: any[] = [];
|
blocks: any[] = [];
|
||||||
blockSubscription: Subscription;
|
blockSubscription: Subscription;
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
interval: any;
|
interval: any;
|
||||||
|
|
||||||
|
latestBlockHeight: number;
|
||||||
|
|
||||||
heightOfPageUntilBlocks = 430;
|
heightOfPageUntilBlocks = 430;
|
||||||
heightOfBlocksTableChunk = 470;
|
heightOfBlocksTableChunk = 470;
|
||||||
|
|
||||||
@ -34,6 +39,8 @@ export class LatestBlocksComponent implements OnInit, OnDestroy {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.latestBlockHeight = block.height;
|
||||||
|
|
||||||
if (block.height === this.blocks[0].height) {
|
if (block.height === this.blocks[0].height) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -66,6 +73,8 @@ export class LatestBlocksComponent implements OnInit, OnDestroy {
|
|||||||
this.blocks = blocks;
|
this.blocks = blocks;
|
||||||
this.isLoading = false;
|
this.isLoading = false;
|
||||||
|
|
||||||
|
this.latestBlockHeight = blocks[0].height;
|
||||||
|
|
||||||
const spaceForBlocks = window.innerHeight - this.heightOfPageUntilBlocks;
|
const spaceForBlocks = window.innerHeight - this.heightOfPageUntilBlocks;
|
||||||
const chunks = Math.ceil(spaceForBlocks / this.heightOfBlocksTableChunk) - 1;
|
const chunks = Math.ceil(spaceForBlocks / this.heightOfBlocksTableChunk) - 1;
|
||||||
if (chunks > 0) {
|
if (chunks > 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user