mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-10 22:13:47 +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"
|
"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 {
|
type stateReq struct {
|
||||||
items []common.Hash
|
items []common.Hash
|
||||||
tasks map[common.Hash]*stateTask
|
tasks map[common.Hash]*stateTask
|
||||||
|
|
@ -315,13 +312,10 @@ func (s *stateSync) process(req *stateReq) (nproc int, err error) {
|
||||||
// to a protocol limit.
|
// to a protocol limit.
|
||||||
delete(task.triedPeers, req.peer.id)
|
delete(task.triedPeers, req.peer.id)
|
||||||
}
|
}
|
||||||
// Check retry limits.
|
// Check retry limit.
|
||||||
if len(task.triedPeers) >= npeers {
|
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)
|
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
|
s.tasksAvailable[hash] = task
|
||||||
}
|
}
|
||||||
return nproc, nil
|
return nproc, nil
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue