Skip to content

Commit

Permalink
chore: move default protocol filter to variable
Browse files Browse the repository at this point in the history
  • Loading branch information
2color committed Oct 1, 2024
1 parent 786590d commit 872a727
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ const (
dhtSource = "Amino DHT"
)

var defaultProtocolFilter = []string{"transport-bitswap", "unknown"}

func newDaemon(ctx context.Context, acceleratedDHT bool) (*daemon, error) {
rm, err := NewResourceManager()
if err != nil {
Expand Down Expand Up @@ -149,7 +151,7 @@ type providerOutput struct {
// concurrently. A check of connectivity and Bitswap availability is performed
// for each provider found.
func (d *daemon) runCidCheck(ctx context.Context, cidKey cid.Cid, ipniURL string) (cidCheckOutput, error) {
crClient, err := client.New(ipniURL, client.WithStreamResultsRequired(), client.WithProtocolFilter([]string{"transport-bitswap", "unknown"}))
crClient, err := client.New(ipniURL, client.WithStreamResultsRequired(), client.WithProtocolFilter(defaultProtocolFilter))
if err != nil {
return nil, fmt.Errorf("failed to create content router client: %w", err)
}
Expand Down

0 comments on commit 872a727

Please sign in to comment.