Skip to content

Commit

Permalink
mm
Browse files Browse the repository at this point in the history
  • Loading branch information
hsanjuan committed Nov 19, 2024
1 parent 870ab41 commit b4ab3e9
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions bitswap/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,6 @@ func WithoutDuplicatedBlockStats() Option {
}
}

// WithContentRouting enables content.Routing lookups to find providers for
// the content to be retrieved using Bitswap.
func WithContentRouting(router routing.Routing) Option {
return func(bs *Client) {
bs.router = router
}
}

// WithDefaultProviderQueryManager indicates wether we should use a the
// default ProviderQueryManager, a wrapper of the content Router which
// provides bounded paralelism and limits for these lookups. The
Expand All @@ -127,7 +119,9 @@ type BlockReceivedNotifier interface {
}

// New initializes a Bitswap client that runs until client.Close is called.
func New(parent context.Context, network bsnet.BitSwapNetwork, bstore blockstore.Blockstore, options ...Option) *Client {
// The Content router paramteter can be nil to disable content-routing
// lookups for content (rely only on bitswap for discovery).
func New(parent context.Context, network bsnet.BitSwapNetwork, router routing.Routing, bstore blockstore.Blockstore, options ...Option) *Client {
// important to use provided parent context (since it may include important
// loggable data). It's probably not a good idea to allow bitswap to be
// coupled to the concerns of the ipfs daemon in this way.
Expand All @@ -138,8 +132,9 @@ func New(parent context.Context, network bsnet.BitSwapNetwork, bstore blockstore
ctx, cancelFunc := context.WithCancel(parent)

bs := &Client{
blockstore: bstore,
network: network,
router: router,
blockstore: bstore,
cancel: cancelFunc,
closing: make(chan struct{}),
counters: new(counters),
Expand Down

0 comments on commit b4ab3e9

Please sign in to comment.