Do not send unsubscribe messages to destroyed Providers (#4678).
This commit is contained in:
parent
38e32d8214
commit
c45935e29c
@ -69,6 +69,7 @@ export class SocketSubscriber implements Subscriber {
|
|||||||
|
|
||||||
stop(): void {
|
stop(): void {
|
||||||
(<Promise<number>>(this.#filterId)).then((filterId) => {
|
(<Promise<number>>(this.#filterId)).then((filterId) => {
|
||||||
|
if (this.#provider.destroyed) { return; }
|
||||||
this.#provider.send("eth_unsubscribe", [ filterId ]);
|
this.#provider.send("eth_unsubscribe", [ filterId ]);
|
||||||
});
|
});
|
||||||
this.#filterId = null;
|
this.#filterId = null;
|
||||||
|
@ -118,6 +118,7 @@ export class FilterIdSubscriber implements Subscriber {
|
|||||||
if (filterIdPromise) {
|
if (filterIdPromise) {
|
||||||
this.#filterIdPromise = null;
|
this.#filterIdPromise = null;
|
||||||
filterIdPromise.then((filterId) => {
|
filterIdPromise.then((filterId) => {
|
||||||
|
if (this.#provider.destroyed) { return; }
|
||||||
this.#provider.send("eth_uninstallFilter", [ filterId ]);
|
this.#provider.send("eth_uninstallFilter", [ filterId ]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user