Skip to content

Commit

Permalink
avid false warn log
Browse files Browse the repository at this point in the history
  • Loading branch information
unclezoro committed Jan 11, 2021
1 parent 60606d3 commit 91d79a2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion consensus/parlia/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down

0 comments on commit 91d79a2

Please sign in to comment.