Special halvening block and fireworks.

fixes #50
This commit is contained in:
softsimon
2020-04-09 17:46:30 +07:00
parent 6483fbe1db
commit 611aa0ec93
5 changed files with 165 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
import { Component, OnInit } from '@angular/core';
import { WebsocketService } from 'src/app/services/websocket.service';
import { StateService } from 'src/app/services/state.service';
@Component({
selector: 'app-start',
@@ -9,11 +10,24 @@ import { WebsocketService } from 'src/app/services/websocket.service';
export class StartComponent implements OnInit {
view: 'blocks' | 'transactions' = 'blocks';
isHalveningeEvent = false;
constructor(
private websocketService: WebsocketService,
private stateService: StateService,
) { }
ngOnInit() {
this.websocketService.want(['blocks', 'stats', 'mempool-blocks']);
this.stateService.blocks$
.subscribe((block) => {
if (block.height % 210000 === 0) {
this.isHalveningeEvent = true;
setTimeout(() => {
this.isHalveningeEvent = false;
}, 60 * 60 * 1000);
}
});
}
}