resume tracking subscriptions after websocket reconnect
This commit is contained in:
parent
cac2a984ab
commit
cb5b96485c
@ -28,8 +28,9 @@ export class WebsocketService {
|
|||||||
private isTrackingTx = false;
|
private isTrackingTx = false;
|
||||||
private trackingTxId: string;
|
private trackingTxId: string;
|
||||||
private isTrackingMempoolBlock = false;
|
private isTrackingMempoolBlock = false;
|
||||||
private isTrackingRbf = false;
|
private isTrackingRbf: 'all' | 'fullRbf' | false = false;
|
||||||
private isTrackingRbfSummary = false;
|
private isTrackingRbfSummary = false;
|
||||||
|
private isTrackingAddress: string | false = false;
|
||||||
private trackingMempoolBlock: number;
|
private trackingMempoolBlock: number;
|
||||||
private latestGitCommit = '';
|
private latestGitCommit = '';
|
||||||
private onlineCheckTimeout: number;
|
private onlineCheckTimeout: number;
|
||||||
@ -110,6 +111,15 @@ export class WebsocketService {
|
|||||||
if (this.isTrackingMempoolBlock) {
|
if (this.isTrackingMempoolBlock) {
|
||||||
this.startTrackMempoolBlock(this.trackingMempoolBlock);
|
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);
|
this.stateService.connectionState$.next(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -151,10 +161,12 @@ export class WebsocketService {
|
|||||||
|
|
||||||
startTrackAddress(address: string) {
|
startTrackAddress(address: string) {
|
||||||
this.websocketSubject.next({ 'track-address': address });
|
this.websocketSubject.next({ 'track-address': address });
|
||||||
|
this.isTrackingAddress = address;
|
||||||
}
|
}
|
||||||
|
|
||||||
stopTrackingAddress() {
|
stopTrackingAddress() {
|
||||||
this.websocketSubject.next({ 'track-address': 'stop' });
|
this.websocketSubject.next({ 'track-address': 'stop' });
|
||||||
|
this.isTrackingAddress = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
startTrackAsset(asset: string) {
|
startTrackAsset(asset: string) {
|
||||||
@ -178,7 +190,7 @@ export class WebsocketService {
|
|||||||
|
|
||||||
startTrackRbf(mode: 'all' | 'fullRbf') {
|
startTrackRbf(mode: 'all' | 'fullRbf') {
|
||||||
this.websocketSubject.next({ 'track-rbf': mode });
|
this.websocketSubject.next({ 'track-rbf': mode });
|
||||||
this.isTrackingRbf = true;
|
this.isTrackingRbf = mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
stopTrackRbf() {
|
stopTrackRbf() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user