Skip to content

Commit

Permalink
Pass clientAddress to firewall
Browse files Browse the repository at this point in the history
  • Loading branch information
gmaclennan authored Mar 9, 2023
1 parent 95fc605 commit 80ea460
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -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) {

0 comments on commit 80ea460

Please sign in to comment.