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
c7a8d0d2
Commit
c7a8d0d2
authored
Jan 30, 2020
by
Adin Schmahmann
Committed by
Steven Allen
Apr 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SearchValue will only update k closest peers to have latest record
parent
85f88e1e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
routing.go
routing.go
+4
-1
No files found.
routing.go
View file @
c7a8d0d2
...
...
@@ -191,7 +191,10 @@ func (dht *IpfsDHT) SearchValue(ctx context.Context, key string, opts ...routing
peers
:=
q
[
0
]
.
globallyQueriedPeers
.
Peers
()
peers
=
kb
.
SortClosestPeers
(
peers
,
kb
.
ConvertKey
(
key
))
for
_
,
p
:=
range
peers
{
for
i
,
p
:=
range
peers
{
if
i
==
dht
.
bucketSize
{
break
}
if
_
,
ok
:=
peersWithBest
[
p
];
!
ok
{
updatePeers
=
append
(
updatePeers
,
p
)
}
...
...
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