You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if tally := snap.Tally[candidate]; tally.Votes < snap.ValSet.Size()/2 {
if tally.Authorize {
logger.Info("BFT: reached majority to add validator")
snap.ValSet.AddValidator(candidate)
} else {
logger.Info("BFT: reached majority to remove validator")
snap.ValSet.RemoveValidator(candidate)
// Discard any previous votes the deauthorized validator cast
for i := 0; i < len(snap.Votes); i++ {
if snap.Votes[i].Validator == candidate {
// Uncast the vote from the cached tally
snap.uncast(snap.Votes[i].Address, snap.Votes[i].Authorize)
// Uncast the vote from the chronological list
snap.Votes = append(snap.Votes[:i], snap.Votes[i+1:]...)
i--
}
}
}
// Discard any previous votes around the just changed account
for i := 0; i < len(snap.Votes); i++ {
if snap.Votes[i].Address == candidate {
snap.Votes = append(snap.Votes[:i], snap.Votes[i+1:]...)
i--
}
}
delete(snap.Tally, candidate)
}
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: