mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
les: recover stable checkpoint if nil
This commit is contained in:
parent
ca0ac58f18
commit
90366b3bb7
1 changed files with 3 additions and 0 deletions
|
|
@ -276,6 +276,9 @@ func (s *LesServer) checkpointLoop(checkpoint *light.TrustedCheckpoint) (err err
|
|||
if number < light.CheckpointConfirmations+light.CheckpointFrequency {
|
||||
continue
|
||||
}
|
||||
if checkpoint == nil {
|
||||
checkpoint = s.recoverCheckpoint()
|
||||
}
|
||||
idx := (number-light.CheckpointConfirmations)/light.CheckpointFrequency - 1
|
||||
if checkpoint == nil || idx > checkpoint.SectionIdx {
|
||||
hash, ok := announcement[idx]
|
||||
|
|
|
|||
Loading…
Reference in a new issue