Prevent destroyed providers from emitting network detection errors.
This commit is contained in:
parent
30d3d6ee32
commit
7d4173049e
@ -693,6 +693,7 @@ export abstract class JsonRpcApiProvider extends AbstractProvider {
|
|||||||
try {
|
try {
|
||||||
this.#network = await this._detectNetwork();
|
this.#network = await this._detectNetwork();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
if (this.destroyed) { break; }
|
||||||
console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)");
|
console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)");
|
||||||
this.emit("error", makeError("failed to bootstrap network detection", "NETWORK_ERROR", { event: "initial-network-discovery", info: { error } }));
|
this.emit("error", makeError("failed to bootstrap network detection", "NETWORK_ERROR", { event: "initial-network-discovery", info: { error } }));
|
||||||
await stall(1000);
|
await stall(1000);
|
||||||
|
Loading…
Reference in New Issue
Block a user