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
ab215553
Unverified
Commit
ab215553
authored
Apr 08, 2020
by
Will Scott
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:libp2p/go-libp2p-kad-dht into feat/dual
parents
668c25a7
0d1a917f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
12 deletions
+0
-12
handlers.go
handlers.go
+0
-12
No files found.
handlers.go
View file @
ab215553
...
...
@@ -316,20 +316,8 @@ func (dht *IpfsDHT) handleGetProviders(ctx context.Context, p peer.ID, pmes *pb.
resp
:=
pb
.
NewMessage
(
pmes
.
GetType
(),
pmes
.
GetKey
(),
pmes
.
GetClusterLevel
())
// check if we have this value, to add ourselves as provider.
has
,
err
:=
dht
.
datastore
.
Has
(
convertToDsKey
(
key
))
if
err
!=
nil
&&
err
!=
ds
.
ErrNotFound
{
// FIXME: This doesn't work reliably. If we want this check, we
// need a _blockstore_.
logger
.
Errorw
(
"error checking datastore for block"
,
"key"
,
key
,
"error"
,
err
)
has
=
false
}
// setup providers
providers
:=
dht
.
ProviderManager
.
GetProviders
(
ctx
,
key
)
if
has
{
providers
=
append
(
providers
,
dht
.
self
)
}
if
len
(
providers
)
>
0
{
// TODO: pstore.PeerInfos should move to core (=> peerstore.AddrInfos).
...
...
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