From 8adda0fffc847623beb73dfa96f2c3ecebb339a3 Mon Sep 17 00:00:00 2001 From: Juan Batiz-Benet Date: Tue, 23 Dec 2014 22:04:21 -0800 Subject: [PATCH] dht: bootstrap query constants --- routing/dht/dht.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/routing/dht/dht.go b/routing/dht/dht.go index 0898fb3d3..fdb5170f7 100644 --- a/routing/dht/dht.go +++ b/routing/dht/dht.go @@ -28,6 +28,10 @@ var log = eventlog.Logger("dht") 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 // 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) { var wg sync.WaitGroup - for i := 0; i < 10; i++ { + for i := 0; i < NumBootstrapQueries; i++ { wg.Add(1) go func() { defer wg.Done()