mirror of
https://github.com/ipfs/kubo.git
synced 2025-07-01 10:49:24 +08:00
dht: bootstrap query constants
This commit is contained in:
@ -28,6 +28,10 @@ var log = eventlog.Logger("dht")
|
|||||||
|
|
||||||
const doPinging = false
|
const doPinging = false
|
||||||
|
|
||||||
|
// NumBootstrapQueries defines the number of random dht queries to do to
|
||||||
|
// collect members of the routing table.
|
||||||
|
const NumBootstrapQueries = 5
|
||||||
|
|
||||||
// TODO. SEE https://github.com/jbenet/node-ipfs/blob/master/submodules/ipfs-dht/index.js
|
// TODO. SEE https://github.com/jbenet/node-ipfs/blob/master/submodules/ipfs-dht/index.js
|
||||||
|
|
||||||
// IpfsDHT is an implementation of Kademlia with Coral and S/Kademlia modifications.
|
// IpfsDHT is an implementation of Kademlia with Coral and S/Kademlia modifications.
|
||||||
@ -364,7 +368,7 @@ func (dht *IpfsDHT) PingRoutine(t time.Duration) {
|
|||||||
func (dht *IpfsDHT) Bootstrap(ctx context.Context) {
|
func (dht *IpfsDHT) Bootstrap(ctx context.Context) {
|
||||||
|
|
||||||
var wg sync.WaitGroup
|
var wg sync.WaitGroup
|
||||||
for i := 0; i < 10; i++ {
|
for i := 0; i < NumBootstrapQueries; i++ {
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
go func() {
|
go func() {
|
||||||
defer wg.Done()
|
defer wg.Done()
|
||||||
|
Reference in New Issue
Block a user