mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 02:42:27 +00:00
p2p: disable random node dialing
This commit is contained in:
parent
8ca21e9d4f
commit
7dd37e6f72
1 changed files with 9 additions and 9 deletions
18
p2p/dial.go
18
p2p/dial.go
|
|
@ -217,15 +217,15 @@ func (s *dialstate) newTasks(nRunning int, peers map[enode.ID]*Peer, now time.Ti
|
|||
}
|
||||
// Use random nodes from the table for half of the necessary
|
||||
// dynamic dials.
|
||||
randomCandidates := needDynDials / 2
|
||||
if randomCandidates > 0 {
|
||||
n := s.ntab.ReadRandomNodes(s.randomNodes)
|
||||
for i := 0; i < randomCandidates && i < n; i++ {
|
||||
if addDial(dynDialedConn, s.randomNodes[i]) {
|
||||
needDynDials--
|
||||
}
|
||||
}
|
||||
}
|
||||
//randomCandidates := needDynDials / 2
|
||||
//if randomCandidates > 0 {
|
||||
//n := s.ntab.ReadRandomNodes(s.randomNodes)
|
||||
//for i := 0; i < randomCandidates && i < n; i++ {
|
||||
//if addDial(dynDialedConn, s.randomNodes[i]) {
|
||||
//needDynDials--
|
||||
//}
|
||||
//}
|
||||
//}
|
||||
// Create dynamic dials from random lookup results, removing tried
|
||||
// items from the result buffer.
|
||||
i := 0
|
||||
|
|
|
|||
Loading…
Reference in a new issue