Small code cleanup and typo fixes (#13325)
* Small code cleanup and typo fixes * Clean up calculate_points_and_credits
This commit is contained in:
@@ -30,8 +30,7 @@ pub const MAX_LOCKOUT_HISTORY: usize = 31;
|
||||
pub const INITIAL_LOCKOUT: usize = 2;
|
||||
|
||||
// Maximum number of credits history to keep around
|
||||
// smaller numbers makes
|
||||
pub const MAX_EPOCH_CREDITS_HISTORY: usize = 64;
|
||||
const MAX_EPOCH_CREDITS_HISTORY: usize = 64;
|
||||
|
||||
#[frozen_abi(digest = "Ch2vVEwos2EjAVqSHCyJjnN2MNX1yrpapZTGhMSCjWUH")]
|
||||
#[derive(Serialize, Default, Deserialize, Debug, PartialEq, Eq, Clone, AbiExample)]
|
||||
@@ -392,8 +391,7 @@ impl VoteState {
|
||||
self.epoch_credits.last_mut().unwrap().0 = epoch;
|
||||
}
|
||||
|
||||
// if stakers do not claim before the epoch goes away they lose the
|
||||
// credits...
|
||||
// Remove too old epoch_credits
|
||||
if self.epoch_credits.len() > MAX_EPOCH_CREDITS_HISTORY {
|
||||
self.epoch_credits.remove(0);
|
||||
}
|
||||
|
Reference in New Issue
Block a user