From 70360e25fe471ea3cdf83d0b1d0033c9cb16f1e8 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Tue, 29 Oct 2019 13:24:55 +0100 Subject: [PATCH] p2p: lower discovery mixer timeout --- p2p/server.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/p2p/server.go b/p2p/server.go index 11a765a64c..246148741f 100644 --- a/p2p/server.go +++ b/p2p/server.go @@ -45,6 +45,11 @@ import ( const ( defaultDialTimeout = 15 * time.Second + // This is the fairness knob for the discovery mixer. When looking for peers, we'll + // wait this long for a single source of candidates before moving on and trying other + // sources. + discmixTimeout = 5 * time.Second + // Connectivity defaults. maxActiveDialTasks = 16 defaultMaxPendingPeers = 50 @@ -525,7 +530,7 @@ func (srv *Server) setupLocalNode() error { } func (srv *Server) setupDiscovery() error { - srv.discmix = enode.NewFairMix(fallbackInterval) + srv.discmix = enode.NewFairMix(discmixTimeout) // Add protocol-specific discovery sources. added := make(map[string]bool)