Commit a2b7b62a authored by Juan Batiz-Benet's avatar Juan Batiz-Benet Committed by Brian Tiger Chow

remove start

parent 80b92f56
......@@ -45,9 +45,6 @@ type IpfsDHT struct {
providers *ProviderManager
// Signal to shutdown dht
shutdown chan struct{}
// When this peer started up
birth time.Time
......@@ -65,7 +62,6 @@ func NewDHT(p *peer.Peer, ps peer.Peerstore, net inet.Network, sender inet.Sende
dht.peerstore = ps
dht.providers = NewProviderManager(p.ID)
dht.shutdown = make(chan struct{})
dht.routingTables = make([]*kb.RoutingTable, 3)
dht.routingTables[0] = kb.NewRoutingTable(20, kb.ConvertPeerID(p.ID), time.Millisecond*30)
......@@ -75,11 +71,6 @@ func NewDHT(p *peer.Peer, ps peer.Peerstore, net inet.Network, sender inet.Sende
return dht
}
// Start up background goroutines needed by the DHT
func (dht *IpfsDHT) Start() {
panic("the service is already started. rmv this method")
}
// Connect to a new peer at the given address, ping and add to the routing table
func (dht *IpfsDHT) Connect(addr *ma.Multiaddr) (*peer.Peer, error) {
maddrstr, _ := addr.String()
......
......@@ -41,7 +41,6 @@ func setupDHT(t *testing.T, p *peer.Peer) *IpfsDHT {
d := NewDHT(p, peerstore, net, dhts, ds.NewMapDatastore())
dhts.Handler = d
d.Start()
return d
}
......@@ -116,8 +115,6 @@ func TestPing(t *testing.T) {
dhtA := setupDHT(t, peerA)
dhtB := setupDHT(t, peerB)
dhtA.Start()
dhtB.Start()
defer dhtA.Halt()
defer dhtB.Halt()
......@@ -150,8 +147,6 @@ func TestValueGetSet(t *testing.T) {
dhtA := setupDHT(t, peerA)
dhtB := setupDHT(t, peerB)
dhtA.Start()
dhtB.Start()
defer dhtA.Halt()
defer dhtB.Halt()
......
......@@ -180,8 +180,6 @@ func (dht *IpfsDHT) handleAddProvider(p *peer.Peer, pmes *Message) (*Message, er
// Halt stops all communications from this peer and shut down
// TODO -- remove this in favor of context
func (dht *IpfsDHT) Halt() {
dht.shutdown <- struct{}{}
dht.network.Close()
dht.providers.Halt()
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment