eth/downloader: remove maxStateNodeRetries

It fails the sync too much.
This commit is contained in:
Felix Lange 2017-05-30 17:26:54 +02:00 committed by Péter Szilágyi
parent 5339c79b54
commit 339bc104b4
No known key found for this signature in database
GPG key ID: E9AE538CEDF8293D

View file

@ -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