From b9e0bece54fff2f0ba34bccc01bdbedbe13145f5 Mon Sep 17 00:00:00 2001 From: Dennis Trautwein Date: Sat, 29 Oct 2022 12:57:47 +0200 Subject: [PATCH] incorporate PR feedback Co-authored-by: Marten Seemann --- p2p/protocol/holepunch/filter.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/p2p/protocol/holepunch/filter.go b/p2p/protocol/holepunch/filter.go index c7c80f916c..98932f045c 100644 --- a/p2p/protocol/holepunch/filter.go +++ b/p2p/protocol/holepunch/filter.go @@ -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. @@ -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 }