mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
eth/downloader: short circuit if nothing to delete
This commit is contained in:
parent
75929ca3e4
commit
de234dfe15
1 changed files with 4 additions and 0 deletions
|
|
@ -1125,6 +1125,10 @@ func (s *skeleton) cleanStales(filled *types.Header) error {
|
|||
if number+1 < s.progress.Subchains[0].Tail {
|
||||
return fmt.Errorf("filled header below beacon header tail: %d < %d", number, s.progress.Subchains[0].Tail)
|
||||
}
|
||||
// If nothing is filled, don't bother to do cleanup.
|
||||
if number+1 == s.progress.Subchains[0].Tail {
|
||||
return nil
|
||||
}
|
||||
// Determine the new tail based on the given filled header. If it's still
|
||||
// in the range of skeleton chain, use the next header adjacent to the
|
||||
// filled one (it's expected to link with the filled one, otherwise
|
||||
|
|
|
|||
Loading…
Reference in a new issue