File tree 1 file changed +2
-16
lines changed
1 file changed +2
-16
lines changed Original file line number Diff line number Diff line change @@ -69,25 +69,11 @@ type IpfsDHT struct {
69
69
70
70
// NewDHT creates a new DHT object with the given peer as the 'local' host
71
71
func NewDHT (ctx context.Context , h host.Host , dstore ds.Batching ) * IpfsDHT {
72
- dht := makeDHT (ctx , h , dstore )
73
-
74
- // register for network notifs.
75
- dht .host .Network ().Notify ((* netNotifiee )(dht ))
76
-
77
- dht .proc = goprocessctx .WithContextAndTeardown (ctx , func () error {
78
- // remove ourselves from network notifs.
79
- dht .host .Network ().StopNotify ((* netNotifiee )(dht ))
80
- return nil
81
- })
82
-
83
- dht .proc .AddChild (dht .providers .Process ())
72
+ dht := NewDHTClient (ctx , h , dstore )
84
73
85
74
h .SetStreamHandler (ProtocolDHT , dht .handleNewStream )
86
75
h .SetStreamHandler (ProtocolDHTOld , dht .handleNewStream )
87
-
88
- dht .Validator ["pk" ] = record .PublicKeyValidator
89
- dht .Selector ["pk" ] = record .PublicKeySelector
90
-
76
+
91
77
return dht
92
78
}
93
79
You can’t perform that action at this time.
0 commit comments