dht: bootstrap query constants
Juan Batiz-Benet committed
Dec 23, 2014 at 22:04 UTC
8adda0fffc847623beb73dfa96f2c3ecebb339a3
1 file changed
+5
-1
routing/dht/dht.go
+5
-1
@@ -28,6 +28,10 @@ var log = eventlog.Logger("dht")
28
29
const doPinging = false
30
31
+// NumBootstrapQueries defines the number of random dht queries to do to
32
+// collect members of the routing table.
33
+const NumBootstrapQueries = 5
34
+
35
// TODO. SEE https://github.com/jbenet/node-ipfs/blob/master/submodules/ipfs-dht/index.js
36
37
// IpfsDHT is an implementation of Kademlia with Coral and S/Kademlia modifications.
@@ -364,7 +368,7 @@ func (dht *IpfsDHT) PingRoutine(t time.Duration) {
368
func (dht *IpfsDHT) Bootstrap(ctx context.Context) {
369
370
var wg sync.WaitGroup
367
- for i := 0; i < 10; i++ {
371
+ for i := 0; i < NumBootstrapQueries; i++ {
372
wg.Add(1)
373
go func() {
374
defer wg.Done()