diff --git a/src/index.ts b/src/index.ts index 331506c..53f64c5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -150,6 +150,8 @@ export default class DHT { const connection = this._relays.get(available[relayIndex]) as string; if (!(await this.isServerAvailable(connection))) { + available.splice(relayIndex, 1); + this.removeRelay(available[relayIndex]); continue; }