Skip to content

Commit 8af12dd

Browse files
committed
chore: remove unused testProtocols
We no longer need this now that we explicitly support v1 compatibility mode.
1 parent 9bab969 commit 8af12dd

File tree

2 files changed

+1
-19
lines changed

2 files changed

+1
-19
lines changed

dht.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -223,13 +223,7 @@ func makeDHT(ctx context.Context, h host.Host, cfg config) (*IpfsDHT, error) {
223223
var protocols, serverProtocols []protocol.ID
224224

225225
// check if custom test protocols were set
226-
if len(cfg.testProtocols) > 0 {
227-
protocols = make([]protocol.ID, len(cfg.testProtocols))
228-
for i, p := range cfg.testProtocols {
229-
protocols[i] = cfg.protocolPrefix + p
230-
}
231-
serverProtocols = protocols
232-
} else if cfg.v1CompatibleMode {
226+
if cfg.v1CompatibleMode {
233227
// In compat mode, query/serve using the old protocol.
234228
//
235229
// DO NOT accept requests on the new protocol. Otherwise:

dht_options.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ type config struct {
5050
peerFilter RouteTableFilterFunc
5151
}
5252

53-
// test parameters
54-
testProtocols []protocol.ID
55-
5653
// set to true if we're operating in v1 dht compatible mode
5754
v1CompatibleMode bool
5855
}
@@ -312,15 +309,6 @@ func RoutingTableFilter(filter RouteTableFilterFunc) Option {
312309
}
313310
}
314311

315-
// customProtocols is only to be used for testing. It sets the protocols that the DHT listens on and queries with to be
316-
// the ones passed in. The custom protocols are still augmented by the Prefix.
317-
func customProtocols(protos ...protocol.ID) Option {
318-
return func(c *config) error {
319-
c.testProtocols = protos
320-
return nil
321-
}
322-
}
323-
324312
// V1CompatibleMode sets the DHT to operate in V1 compatible mode. In this mode,
325313
// the DHT node will act like a V1 DHT node (use the V1 protocol names) but will
326314
// use the V2 query and routing table logic.

0 commit comments

Comments
 (0)