Skip to content

Commit

Permalink
fix: only track relay-only incoming peers
Browse files Browse the repository at this point in the history
  • Loading branch information
dennis-tra committed Oct 21, 2022
1 parent cc0f996 commit 2c7a54f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cmd/honeypot/notifiee.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ func (h *Host) handleNewConnection(conn network.Conn) error {
return nil
}

// Check if the remote peer only has relay addresses
for _, maddr := range maddrs {
if !manet.IsPrivateAddr(maddr) && !util.IsRelayedMaddr(maddr) {
log.Debugln("Incoming connection, has a public non-relay address")
return nil
}
}

log.Infoln("OK ", maddrs)

// It can happen that the `conn.RemoteMultiaddr()` is not part of the peer store maddrs.
found := false
for _, maddr := range maddrs {
Expand Down

0 comments on commit 2c7a54f

Please sign in to comment.