diff --git a/src/index.ts b/src/index.ts index 6496638..9981094 100644 --- a/src/index.ts +++ b/src/index.ts @@ -40,6 +40,10 @@ export class SwarmClient extends Client { strategy: "fibo", maxAttempts: Number.MAX_SAFE_INTEGER, }); + + this._connectBackoff.on("retry", (error: any) => { + this.logErr(error); + }); } get swarm(): number | undefined { @@ -83,10 +87,6 @@ export class SwarmClient extends Client { async start(): Promise { await this._connectBackoff.run(() => this.init()); - this._connectBackoff.on("retry", (error: any) => { - this.logErr(error); - }); - await this.ready(); }