From 377b9548cfb233721722f2be58c8f095adb3e993 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Tue, 26 Jul 2022 21:38:05 -0400 Subject: [PATCH] *Prevent ready from running fillConnections twice --- src/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/index.ts b/src/index.ts index eb5caae..be13b5b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -31,6 +31,10 @@ export default class DHT { } ready(): Promise { + if (this._inited) { + return Promise.resolve(); + } + this._inited = true; return this.fillConnections(); }