From ec1c71c10415a3dfe6e0b6bf4b36d8840fcded3e Mon Sep 17 00:00:00 2001 From: Mathias Buus Date: Fri, 21 May 2021 22:27:19 +0200 Subject: [PATCH] resolve sample promise always after ready --- index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/index.js b/index.js index 444b24d..b6f3bb0 100644 --- a/index.js +++ b/index.js @@ -197,6 +197,12 @@ class DHT extends EventEmitter { if (this.bootstrapped) return this.bootstrapped = true + + if (this._resolveSampled !== null) { + this._resolveSampled(true) + this._resolveSampled = null + } + this.emit('ready') }