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
8f3ea4e6
Commit
8f3ea4e6
authored
Mar 24, 2017
by
Jeromy Johnson
Committed by
GitHub
Mar 24, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #54 from libp2p/feat/add-peerinfo-provs
Add addresses from received provider records
parents
55cd2914
52e620c6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
routing.go
routing.go
+3
-0
No files found.
routing.go
View file @
8f3ea4e6
...
@@ -349,6 +349,9 @@ func (dht *IpfsDHT) findProvidersAsyncRoutine(ctx context.Context, key *cid.Cid,
...
@@ -349,6 +349,9 @@ func (dht *IpfsDHT) findProvidersAsyncRoutine(ctx context.Context, key *cid.Cid,
// Add unique providers from request, up to 'count'
// Add unique providers from request, up to 'count'
for
_
,
prov
:=
range
provs
{
for
_
,
prov
:=
range
provs
{
if
prov
.
ID
!=
dht
.
self
{
dht
.
peerstore
.
AddAddrs
(
prov
.
ID
,
prov
.
Addrs
,
pstore
.
TempAddrTTL
)
}
log
.
Debugf
(
"got provider: %s"
,
prov
)
log
.
Debugf
(
"got provider: %s"
,
prov
)
if
ps
.
TryAdd
(
prov
.
ID
)
{
if
ps
.
TryAdd
(
prov
.
ID
)
{
log
.
Debugf
(
"using provider: %s"
,
prov
)
log
.
Debugf
(
"using provider: %s"
,
prov
)
...
...
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