Merge pull request #5641 from mempool/mononaut/fix-mempool-network-change

fix stuck mempool block on network change
This commit is contained in:
wiz 2024-12-06 17:14:35 +09:00 committed by GitHub
commit 97a9ea47fc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -37,6 +37,7 @@ export class WebsocketService {
private isTrackingWallet: boolean = false;
private trackingWalletName: string;
private trackingMempoolBlock: number;
private trackingMempoolBlockNetwork: string;
private stoppingTrackMempoolBlock: any | null = null;
private latestGitCommit = '';
private onlineCheckTimeout: number;
@ -226,10 +227,11 @@ export class WebsocketService {
clearTimeout(this.stoppingTrackMempoolBlock);
}
// skip duplicate tracking requests
if (force || this.trackingMempoolBlock !== block) {
if (force || this.trackingMempoolBlock !== block || this.network !== this.trackingMempoolBlockNetwork) {
this.websocketSubject.next({ 'track-mempool-block': block });
this.isTrackingMempoolBlock = true;
this.trackingMempoolBlock = block;
this.trackingMempoolBlockNetwork = this.network;
return true;
}
return false;