Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3-routing
Commits
a2b7b62a
Commit
a2b7b62a
authored
Sep 18, 2014
by
Juan Batiz-Benet
Committed by
Brian Tiger Chow
Sep 22, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove start
parent
80b92f56
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
16 deletions
+0
-16
dht/dht.go
dht/dht.go
+0
-9
dht/dht_test.go
dht/dht_test.go
+0
-5
dht/handlers.go
dht/handlers.go
+0
-2
No files found.
dht/dht.go
View file @
a2b7b62a
...
...
@@ -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
()
...
...
dht/dht_test.go
View file @
a2b7b62a
...
...
@@ -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
()
...
...
dht/handlers.go
View file @
a2b7b62a
...
...
@@ -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
()
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment