Skip to content

Commit

Permalink
incorporate PR feedback
Browse files Browse the repository at this point in the history
Co-authored-by: Marten Seemann <martenseemann@gmail.com>
  • Loading branch information
dennis-tra and marten-seemann committed Oct 29, 2022
1 parent 992c68d commit 0a3f9cf
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions p2p/protocol/holepunch/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
ma "github.com/multiformats/go-multiaddr"
)

// WithAddrFilter is a Service option that enables multi address filtering.
// It allows to only allow a subset of observed addresses to the remote
// WithAddrFilter is a Service option that enables multiaddress filtering.
// It allows to only send a subset of observed addresses to the remote
// peer. E.g., only announce TCP or QUIC multi addresses instead of both.
// It also allows to only consider a subset of received multi addresses
// that remote peers announced to us.
Expand All @@ -19,12 +19,10 @@ func WithAddrFilter(maf AddrFilter) Option {
}

// AddrFilter defines the interface for the multi address filtering.
// - FilterLocal is a function that filters the multi addresses that
// we send to the remote peer.
// - FilterRemote is a function that filters the multi addresses which
// we received from the remote peer.
type AddrFilter interface {
// FilterLocal is a function that filters the multi addresses that we send to the remote peer.
FilterLocal(remoteID peer.ID, maddrs []ma.Multiaddr) []ma.Multiaddr
// FilterRemote is a function that filters the multi addresses which we received from the remote peer.
FilterRemote(remoteID peer.ID, maddrs []ma.Multiaddr) []ma.Multiaddr
}

Expand Down

0 comments on commit 0a3f9cf

Please sign in to comment.