mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-02-26 15:47:21 +00:00
Update snapshot.go
This commit is contained in:
parent
395425902d
commit
4c2f2c8f0e
1 changed files with 2 additions and 2 deletions
|
|
@ -196,7 +196,7 @@ func (s *Snapshot) apply(headers []*types.Header) (*Snapshot, error) {
|
|||
snap.Tally = make(map[common.Address]Tally)
|
||||
}
|
||||
// Delete the oldest signer from the recent list to allow it signing again
|
||||
if limit := uint64(len(snap.Signers)/2 + 1); number >= limit {
|
||||
if limit := uint64((len(snap.Signers) + 1) / 2); number >= limit {
|
||||
delete(snap.Recents, number-limit)
|
||||
}
|
||||
// Resolve the authorization key and check against signers
|
||||
|
|
@ -251,7 +251,7 @@ func (s *Snapshot) apply(headers []*types.Header) (*Snapshot, error) {
|
|||
delete(snap.Signers, header.Coinbase)
|
||||
|
||||
// Signer list shrunk, delete any leftover recent caches
|
||||
if limit := uint64(len(snap.Signers)/2 + 1); number >= limit {
|
||||
if limit := uint64((len(snap.Signers) + 1) / 2); number >= limit {
|
||||
delete(snap.Recents, number-limit)
|
||||
}
|
||||
// Discard any previous votes the deauthorized signer cast
|
||||
|
|
|
|||
Loading…
Reference in a new issue