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
0d1a917f
Unverified
Commit
0d1a917f
authored
Apr 08, 2020
by
Steven Allen
Committed by
GitHub
Apr 08, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #577 from libp2p/fix/provider-check
fix: remove local provider check
parents
796b95bc
4bac0452
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 @
0d1a917f
...
...
@@ -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