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
p2p
go-p2p-kad-dht
Commits
3867e321
Commit
3867e321
authored
Sep 16, 2014
by
Juan Batiz-Benet
Committed by
Brian Tiger Chow
Sep 22, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Peerstore to dht
parent
fdccc21d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
dht.go
dht.go
+5
-1
No files found.
dht.go
View file @
3867e321
...
...
@@ -36,6 +36,9 @@ type IpfsDHT struct {
// Local peer (yourself)
self
*
peer
.
Peer
// Other peers
peerstore
peer
.
Peerstore
// Local data
datastore
ds
.
Datastore
dslock
sync
.
Mutex
...
...
@@ -53,12 +56,13 @@ type IpfsDHT struct {
}
// NewDHT creates a new DHT object with the given peer as the 'local' host
func
NewDHT
(
p
*
peer
.
Peer
,
net
inet
.
Network
,
sender
inet
.
Sender
,
dstore
ds
.
Datastore
)
*
IpfsDHT
{
func
NewDHT
(
p
*
peer
.
Peer
,
ps
peer
.
Peerstore
,
net
inet
.
Network
,
sender
inet
.
Sender
,
dstore
ds
.
Datastore
)
*
IpfsDHT
{
dht
:=
new
(
IpfsDHT
)
dht
.
network
=
net
dht
.
sender
=
sender
dht
.
datastore
=
dstore
dht
.
self
=
p
dht
.
peerstore
=
ps
dht
.
providers
=
NewProviderManager
(
p
.
ID
)
dht
.
shutdown
=
make
(
chan
struct
{})
...
...
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