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
c3a2a104
Commit
c3a2a104
authored
Jul 05, 2016
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix handling of dht records and local fixups
License: MIT Signed-off-by:
Jeromy
<
why@ipfs.io
>
parent
29c36b20
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
routing.go
routing.go
+7
-0
No files found.
routing.go
View file @
c3a2a104
...
...
@@ -122,6 +122,13 @@ func (dht *IpfsDHT) GetValue(ctx context.Context, key key.Key) ([]byte, error) {
// if someone sent us a different 'less-valid' record, lets correct them
if
!
bytes
.
Equal
(
v
.
Val
,
best
)
{
go
func
(
v
routing
.
RecvdVal
)
{
if
v
.
From
==
dht
.
self
{
err
:=
dht
.
putLocal
(
key
,
fixupRec
)
if
err
!=
nil
{
log
.
Error
(
"Error correcting local dht entry:"
,
err
)
}
return
}
ctx
,
cancel
:=
context
.
WithTimeout
(
dht
.
Context
(),
time
.
Second
*
30
)
defer
cancel
()
err
:=
dht
.
putValueToPeer
(
ctx
,
v
.
From
,
key
,
fixupRec
)
...
...
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