mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-28 15:46:43 +00:00
eth/downloader: remove maxStateNodeRetries
It fails the sync too much.
This commit is contained in:
parent
5339c79b54
commit
339bc104b4
1 changed files with 1 additions and 7 deletions
|
|
@ -31,9 +31,6 @@ import (
|
|||
"github.com/ethereum/go-ethereum/trie"
|
||||
)
|
||||
|
||||
// If a single state node is tried more than this many times, sync fails.
|
||||
const maxStateNodeRetries = 50
|
||||
|
||||
type stateReq struct {
|
||||
items []common.Hash
|
||||
tasks map[common.Hash]*stateTask
|
||||
|
|
@ -315,13 +312,10 @@ func (s *stateSync) process(req *stateReq) (nproc int, err error) {
|
|||
// to a protocol limit.
|
||||
delete(task.triedPeers, req.peer.id)
|
||||
}
|
||||
// Check retry limits.
|
||||
// Check retry limit.
|
||||
if len(task.triedPeers) >= npeers {
|
||||
return nproc, fmt.Errorf("state node %s failed with all peers (%d tries, %d peers)", hash.TerminalString(), len(task.triedPeers), npeers)
|
||||
}
|
||||
if task.numTries > maxStateNodeRetries && task.numTries >= npeers {
|
||||
return nproc, fmt.Errorf("download of state node %s failed %d times", hash.TerminalString(), task.numTries)
|
||||
}
|
||||
s.tasksAvailable[hash] = task
|
||||
}
|
||||
return nproc, nil
|
||||
|
|
|
|||
Loading…
Reference in a new issue