mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-07 00:42:42 +00:00
Fix incorrect cache drops in advance_caches
This commit is contained in:
@@ -799,13 +799,11 @@ impl<T: EthSpec> BeaconState<T> {
|
|||||||
///
|
///
|
||||||
/// Note: whilst this function will preserve already-built caches, it will not build any.
|
/// Note: whilst this function will preserve already-built caches, it will not build any.
|
||||||
pub fn advance_caches(&mut self) {
|
pub fn advance_caches(&mut self) {
|
||||||
let next = Self::committee_cache_index(RelativeEpoch::Previous);
|
|
||||||
let current = Self::committee_cache_index(RelativeEpoch::Current);
|
|
||||||
|
|
||||||
let caches = &mut self.committee_caches[..];
|
let caches = &mut self.committee_caches[..];
|
||||||
caches.rotate_left(1);
|
caches.rotate_left(1);
|
||||||
|
|
||||||
|
let next = Self::committee_cache_index(RelativeEpoch::Next);
|
||||||
caches[next] = CommitteeCache::default();
|
caches[next] = CommitteeCache::default();
|
||||||
caches[current] = CommitteeCache::default();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn committee_cache_index(relative_epoch: RelativeEpoch) -> usize {
|
fn committee_cache_index(relative_epoch: RelativeEpoch) -> usize {
|
||||||
|
|||||||
Reference in New Issue
Block a user