remove old autorelay code

This commit is contained in:
Mantas Vidutis 2019-01-04 11:56:06 -08:00
parent d7b74b2c88
commit bc328b5fe6
2 changed files with 0 additions and 22 deletions

View File

@ -7,7 +7,6 @@ import (
logging "github.com/ipfs/go-log"
libp2p "github.com/libp2p/go-libp2p"
discovery "github.com/libp2p/go-libp2p-discovery"
host "github.com/libp2p/go-libp2p-host"
dht "github.com/libp2p/go-libp2p-kad-dht"
dhtopts "github.com/libp2p/go-libp2p-kad-dht/opts"
@ -15,7 +14,6 @@ import (
proto "github.com/libp2p/go-libp2p-protocol"
ps "github.com/libp2p/go-libp2p-pubsub"
routing "github.com/libp2p/go-libp2p-routing"
bhost "github.com/libp2p/go-libp2p/p2p/host/basic"
relay "github.com/libp2p/go-libp2p/p2p/host/relay"
ma "github.com/multiformats/go-multiaddr"
manet "github.com/multiformats/go-multiaddr-net"
@ -118,16 +116,6 @@ func (d *Daemon) EnablePubsub(router string, sign, strict bool) error {
}
func (d *Daemon) EnableAutoRelay() error {
if d.dht == nil {
return fmt.Errorf("DHT must be enabled for autorelay")
}
disc := discovery.NewRoutingDiscovery(d.dht)
d.autorelay = relay.NewAutoRelayHost(d.ctx, d.host.(*bhost.BasicHost), disc)
return nil
}
func (d *Daemon) ID() peer.ID {
return d.host.ID()
}

View File

@ -138,16 +138,6 @@ func main() {
}
}
if *autoRelay {
if !*relayEnabled {
log.Fatal("Relay must be enabled to enable auto relay")
}
err = d.EnableAutoRelay()
if err != nil {
log.Fatal(err)
}
}
if !*quiet {
fmt.Printf("Control socket: %s\n", maddr.String())
fmt.Printf("Peer ID: %s\n", d.ID().Pretty())