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
14545294
Commit
14545294
authored
Aug 29, 2019
by
Steven Allen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dep: update go-libp2p-kbucket
parent
585d6725
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
6 deletions
+2
-6
dht_bootstrap.go
dht_bootstrap.go
+2
-6
No files found.
dht_bootstrap.go
View file @
14545294
...
...
@@ -166,16 +166,12 @@ func (dht *IpfsDHT) runBootstrap(ctx context.Context, cfg BootstrapConfig) error
errChan
:=
make
(
chan
error
)
for
bucketID
,
bucket
:=
range
buckets
{
if
time
.
Since
(
bucket
.
LastQueri
edAt
())
>
cfg
.
BucketPeriod
{
if
time
.
Since
(
bucket
.
Refresh
edAt
())
>
cfg
.
BucketPeriod
{
wg
.
Add
(
1
)
go
func
(
bucketID
int
,
errChan
chan
<-
error
)
{
defer
wg
.
Done
()
// gen rand peer in the bucket
randPeerInBucket
,
err
:=
dht
.
routingTable
.
GenRandPeerID
(
bucketID
)
if
err
!=
nil
{
errChan
<-
errors
.
Wrapf
(
err
,
"failed to generate random peer ID in bucket %d"
,
bucketID
)
return
}
randPeerInBucket
:=
dht
.
routingTable
.
GenRandPeerID
(
bucketID
)
// walk to the generated peer
walkFnc
:=
func
(
c
context
.
Context
)
error
{
...
...
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