fix: patch dht-relay handshake logic to prevent duplicate processing

This commit is contained in:
Derrick Hammer 2023-07-24 13:30:14 -04:00
parent 873bc3da52
commit 12cb3a3b5e
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,13 @@
diff --git a/node_modules/@hyperswarm/dht-relay/lib/node.js b/node_modules/@hyperswarm/dht-relay/lib/node.js
index 9ee8ef9..8a37655 100644
--- a/node_modules/@hyperswarm/dht-relay/lib/node.js
+++ b/node_modules/@hyperswarm/dht-relay/lib/node.js
@@ -407,7 +407,7 @@ function onNoiseReceive (message) {
if (message.isInitiator) {
const handshake = this._handshakes.get(message.id)
- if (handshake) {
+ if (handshake && !handshake.complete) {
handshake._onNoiseReceive(message)
}
} else {