handle testnet

This commit is contained in:
Cassandra Heart 2024-11-07 01:55:03 -06:00
parent 32ed742489
commit 7ca0c9bd37
No known key found for this signature in database
GPG Key ID: 6352152859385958

View File

@ -724,11 +724,17 @@ func initDHT(
} else {
mode = dht.ModeClient
}
opts := []dht.Option{
dht.Mode(mode),
dht.BootstrapPeers(bootstrappers...),
}
if network != 0 {
opts = append(opts, dht.ProtocolPrefix(protocol.ID("/testnet")))
}
kademliaDHT, err := dht.New(
ctx,
h,
dht.Mode(mode),
dht.BootstrapPeers(bootstrappers...),
opts...,
)
if err != nil {
panic(err)