Smarter update algorithm for projected block viz

This commit is contained in:
Mononaut
2022-05-31 18:00:40 +00:00
parent ce276e3a7d
commit 371fe8673c
5 changed files with 234 additions and 15 deletions

View File

@@ -27,6 +27,7 @@ export class WebsocketService {
private lastWant: string | null = null;
private isTrackingTx = false;
private trackingTxId: string;
private isTrackingMempoolBlock = false;
private trackingMempoolBlock: number;
private latestGitCommit = '';
private onlineCheckTimeout: number;
@@ -103,6 +104,9 @@ export class WebsocketService {
if (this.isTrackingTx) {
this.startMultiTrackTransaction(this.trackingTxId);
}
if (this.isTrackingMempoolBlock) {
this.startTrackMempoolBlock(this.trackingMempoolBlock);
}
this.stateService.connectionState$.next(2);
}
@@ -160,12 +164,13 @@ export class WebsocketService {
startTrackMempoolBlock(block: number) {
this.websocketSubject.next({ 'track-mempool-block': block });
this.isTrackingMempoolBlock = true
this.trackingMempoolBlock = block
}
stopTrackMempoolBlock() {
this.websocketSubject.next({ 'track-mempool-block': -1 });
this.trackingMempoolBlock = -1
this.isTrackingMempoolBlock = false
}
startTrackBisqMarket(market: string) {