From e5d2d692fdf3d3c84a7027fc6893d454468c996c Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Tue, 11 Feb 2020 20:47:28 +0100 Subject: [PATCH] quic: fix socket-bound check in kMaybeBind PR-URL: https://github.com/nodejs/quic/pull/339 Reviewed-By: James M Snell --- lib/internal/quic/core.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/quic/core.js b/lib/internal/quic/core.js index 406c3d456b..77189ce097 100644 --- a/lib/internal/quic/core.js +++ b/lib/internal/quic/core.js @@ -1052,7 +1052,7 @@ class QuicSocket extends EventEmitter { // Function is a non-op if the socket is already bound or in the process of // being bound, and will call the callback once the socket is ready. [kMaybeBind](callback = () => {}) { - if (this.bound) + if (this.#state === kSocketBound) return process.nextTick(callback); this.once('ready', callback);