*Refactor start

This commit is contained in:
Derrick Hammer 2023-02-17 08:08:43 -05:00
parent 3ede7224aa
commit ba0832588d
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 2 additions and 5 deletions

View File

@ -69,8 +69,6 @@ export class SwarmClient extends Client {
}
async start(): Promise<void> {
let ready = this.ready();
const backoff = () => setImmediate(() => this._connectBackoff.backoff());
try {
@ -78,11 +76,10 @@ export class SwarmClient extends Client {
} catch (e) {
this.logErr(e);
backoff();
return;
}
this.once("close", backoff);
await ready;
await this.ready();
}
public async addRelay(pubkey: string): Promise<void> {