Skip to content

Commit

Permalink
remove Client functional option
Browse files Browse the repository at this point in the history
  • Loading branch information
aschmahmann committed Mar 6, 2020
1 parent 0269408 commit 5577ec7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
2 changes: 1 addition & 1 deletion dht.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func NewDHT(ctx context.Context, h host.Host, dstore ds.Batching) *IpfsDHT {
// requests. If you need a peer to respond to DHT requests, use NewDHT instead.
// NewDHTClient creates a new DHT object with the given peer as the 'local' host
func NewDHTClient(ctx context.Context, h host.Host, dstore ds.Batching) *IpfsDHT {
dht, err := New(ctx, h, opts.Datastore(dstore), opts.Client(true))
dht, err := New(ctx, h, opts.Datastore(dstore), opts.Mode(opts.ModeClient))
if err != nil {
panic(err)
}
Expand Down
12 changes: 0 additions & 12 deletions opts/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,18 +130,6 @@ func Datastore(ds ds.Batching) Option {
}
}

// Client configures whether or not the DHT operates in client-only mode.
//
// Defaults to false.
func Client(only bool) Option {
return func(o *Options) error {
if only {
o.Mode = ModeClient
}
return nil
}
}

// Mode configures which mode the DHT operates in (Client, Server, Auto).
//
// Defaults to ModeAuto.
Expand Down

0 comments on commit 5577ec7

Please sign in to comment.