From 80ea460c2e2774c6aaa043009150893df6dc8489 Mon Sep 17 00:00:00 2001 From: Gregor MacLennan Date: Thu, 9 Mar 2023 12:30:55 +0000 Subject: [PATCH] Pass clientAddress to firewall --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 3687c3a5..efa76812 100644 --- a/index.js +++ b/index.js @@ -195,13 +195,13 @@ module.exports = class Hyperswarm extends EventEmitter { if (this._connecting === 0) this._flushAllMaybe() } - _handleFirewall (remotePublicKey, payload) { + _handleFirewall (remotePublicKey, payload, clientAddress) { if (b4a.equals(remotePublicKey, this.keyPair.publicKey)) return true const peerInfo = this.peers.get(b4a.toString(remotePublicKey, 'hex')) if (peerInfo && peerInfo.banned) return true - return this._firewall(remotePublicKey, payload) + return this._firewall(remotePublicKey, payload, clientAddress) } _handleServerConnectionSwap (existing, conn) {