diff --git a/consensus/parlia/snapshot.go b/consensus/parlia/snapshot.go index 29c76a6e94..0b3ff3f519 100644 --- a/consensus/parlia/snapshot.go +++ b/consensus/parlia/snapshot.go @@ -211,7 +211,13 @@ func (s *Snapshot) apply(headers []*types.Header, chain consensus.ChainReader, p delete(snap.Recents, number-uint64(newLimit)-uint64(i)) } } - snap.RecentForkHashes = make(map[uint64]string, 0) + oldLimit = len(snap.Validators) + newLimit = len(newVals) + if newLimit < oldLimit { + for i := 0; i < oldLimit-newLimit; i++ { + delete(snap.RecentForkHashes, number-uint64(newLimit)-uint64(i)) + } + } snap.Validators = newVals } snap.RecentForkHashes[number] = hex.EncodeToString(header.Extra[extraVanity-nextForkHashSize : extraVanity])