From 5577ec750a9524e86ae0653160dcc9e12f8e6c62 Mon Sep 17 00:00:00 2001 From: Adin Schmahmann Date: Fri, 6 Mar 2020 11:56:51 -0500 Subject: [PATCH] remove Client functional option --- dht.go | 2 +- opts/options.go | 12 ------------ 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/dht.go b/dht.go index 4a79361df..2ff82fca0 100644 --- a/dht.go +++ b/dht.go @@ -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) } diff --git a/opts/options.go b/opts/options.go index 5d6c9d0d6..4b436a3ac 100644 --- a/opts/options.go +++ b/opts/options.go @@ -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.