From dcc389a472efbd072ad210da7eda936151ea8ef5 Mon Sep 17 00:00:00 2001 From: Anton Evangelatov Date: Fri, 18 Jan 2019 14:45:08 +0100 Subject: [PATCH] p2p: revert back lookup discovery task --- p2p/dial.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/p2p/dial.go b/p2p/dial.go index 9b99a61432..dd5b0970f2 100644 --- a/p2p/dial.go +++ b/p2p/dial.go @@ -208,7 +208,8 @@ func (s *dialstate) newTasks(nRunning int, peers map[enode.ID]*Peer, now time.Ti // scenario is useful for the testnet (and private networks) where the discovery // table might be full of mostly bad peers, making it hard to find good ones. log.Trace("before if", "len(s.bootnodes)", len(s.bootnodes), "needdyndials", needDynDials, "bool", now.Sub(s.start) > fallbackInterval) - if len(peers) == 0 && len(s.bootnodes) > 0 && needDynDials > 0 && now.Sub(s.start) > fallbackInterval { + //if len(peers) == 0 && len(s.bootnodes) > 0 && needDynDials > 0 && now.Sub(s.start) > fallbackInterval { + if len(peers) == 0 && len(s.bootnodes) > 0 && needDynDials > 0 { bootnode := s.bootnodes[0] s.bootnodes = append(s.bootnodes[:0], s.bootnodes[1:]...) s.bootnodes = append(s.bootnodes, bootnode) @@ -231,8 +232,8 @@ func (s *dialstate) newTasks(nRunning int, peers map[enode.ID]*Peer, now time.Ti //} //} //} - // Create dynamic dials from random lookup results, removing tried - // items from the result buffer. + //Create dynamic dials from random lookup results, removing tried + //items from the result buffer. //i := 0 //for ; i < len(s.lookupBuf) && needDynDials > 0; i++ { //if addDial(dynDialedConn, s.lookupBuf[i]) { @@ -240,7 +241,7 @@ func (s *dialstate) newTasks(nRunning int, peers map[enode.ID]*Peer, now time.Ti //} //} //s.lookupBuf = s.lookupBuf[:copy(s.lookupBuf, s.lookupBuf[i:])] - // Launch a discovery lookup if more candidates are needed. + ////Launch a discovery lookup if more candidates are needed. //if len(s.lookupBuf) < needDynDials && !s.lookupRunning { //s.lookupRunning = true //newtasks = append(newtasks, &discoverTask{})