Skip to content

Commit 4c2f2c8

Browse files
authored
Update snapshot.go
1 parent 3954259 commit 4c2f2c8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

consensus/clique/snapshot.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ func (s *Snapshot) apply(headers []*types.Header) (*Snapshot, error) {
196196
snap.Tally = make(map[common.Address]Tally)
197197
}
198198
// Delete the oldest signer from the recent list to allow it signing again
199-
if limit := uint64(len(snap.Signers)/2 + 1); number >= limit {
199+
if limit := uint64((len(snap.Signers) + 1) / 2); number >= limit {
200200
delete(snap.Recents, number-limit)
201201
}
202202
// Resolve the authorization key and check against signers
@@ -251,7 +251,7 @@ func (s *Snapshot) apply(headers []*types.Header) (*Snapshot, error) {
251251
delete(snap.Signers, header.Coinbase)
252252

253253
// Signer list shrunk, delete any leftover recent caches
254-
if limit := uint64(len(snap.Signers)/2 + 1); number >= limit {
254+
if limit := uint64((len(snap.Signers) + 1) / 2); number >= limit {
255255
delete(snap.Recents, number-limit)
256256
}
257257
// Discard any previous votes the deauthorized signer cast

0 commit comments

Comments
 (0)