mirror of
https://github.com/mempool/mempool.git
synced 2025-02-24 14:50:52 +01:00
resume tracking subscriptions after websocket reconnect
This commit is contained in:
parent
cac2a984ab
commit
cb5b96485c
1 changed files with 14 additions and 2 deletions
|
@ -28,8 +28,9 @@ export class WebsocketService {
|
|||
private isTrackingTx = false;
|
||||
private trackingTxId: string;
|
||||
private isTrackingMempoolBlock = false;
|
||||
private isTrackingRbf = false;
|
||||
private isTrackingRbf: 'all' | 'fullRbf' | false = false;
|
||||
private isTrackingRbfSummary = false;
|
||||
private isTrackingAddress: string | false = false;
|
||||
private trackingMempoolBlock: number;
|
||||
private latestGitCommit = '';
|
||||
private onlineCheckTimeout: number;
|
||||
|
@ -110,6 +111,15 @@ export class WebsocketService {
|
|||
if (this.isTrackingMempoolBlock) {
|
||||
this.startTrackMempoolBlock(this.trackingMempoolBlock);
|
||||
}
|
||||
if (this.isTrackingRbf) {
|
||||
this.startTrackRbf(this.isTrackingRbf);
|
||||
}
|
||||
if (this.isTrackingRbfSummary) {
|
||||
this.startTrackRbfSummary();
|
||||
}
|
||||
if (this.isTrackingAddress) {
|
||||
this.startTrackAddress(this.isTrackingAddress);
|
||||
}
|
||||
this.stateService.connectionState$.next(2);
|
||||
}
|
||||
|
||||
|
@ -151,10 +161,12 @@ export class WebsocketService {
|
|||
|
||||
startTrackAddress(address: string) {
|
||||
this.websocketSubject.next({ 'track-address': address });
|
||||
this.isTrackingAddress = address;
|
||||
}
|
||||
|
||||
stopTrackingAddress() {
|
||||
this.websocketSubject.next({ 'track-address': 'stop' });
|
||||
this.isTrackingAddress = false;
|
||||
}
|
||||
|
||||
startTrackAsset(asset: string) {
|
||||
|
@ -178,7 +190,7 @@ export class WebsocketService {
|
|||
|
||||
startTrackRbf(mode: 'all' | 'fullRbf') {
|
||||
this.websocketSubject.next({ 'track-rbf': mode });
|
||||
this.isTrackingRbf = true;
|
||||
this.isTrackingRbf = mode;
|
||||
}
|
||||
|
||||
stopTrackRbf() {
|
||||
|
|
Loading…
Add table
Reference in a new issue