From 12cb3a3b5ee16bbda03458627a0ea67f89d7576b Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Mon, 24 Jul 2023 13:30:14 -0400 Subject: [PATCH] fix: patch dht-relay handshake logic to prevent duplicate processing --- patches/@hyperswarm+dht-relay+0.4.1.patch | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 patches/@hyperswarm+dht-relay+0.4.1.patch diff --git a/patches/@hyperswarm+dht-relay+0.4.1.patch b/patches/@hyperswarm+dht-relay+0.4.1.patch new file mode 100644 index 0000000..c2fe466 --- /dev/null +++ b/patches/@hyperswarm+dht-relay+0.4.1.patch @@ -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 {