This repository was archived by the owner on Jan 22, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ impl LeaderScheduleCache {
4646 pub fn new ( epoch_schedule : EpochSchedule , root_bank : & Bank ) -> Self {
4747 let cache = Self {
4848 cached_schedules : RwLock :: new ( ( HashMap :: new ( ) , VecDeque :: new ( ) ) ) ,
49- epoch_schedule : epoch_schedule . clone ( ) ,
49+ epoch_schedule,
5050 max_epoch : RwLock :: new ( 0 ) ,
5151 max_schedules : CacheCapacity :: default ( ) ,
5252 fixed_schedule : None ,
@@ -56,9 +56,11 @@ impl LeaderScheduleCache {
5656 cache. set_root ( root_bank) ;
5757
5858 // Calculate the schedule for all epochs between 0 and leader_schedule_epoch(root)
59- let leader_schedule_epoch = epoch_schedule. get_leader_schedule_epoch ( root_bank. slot ( ) ) ;
59+ let leader_schedule_epoch = cache
60+ . epoch_schedule
61+ . get_leader_schedule_epoch ( root_bank. slot ( ) ) ;
6062 for epoch in 0 ..leader_schedule_epoch {
61- let first_slot_in_epoch = epoch_schedule. get_first_slot_in_epoch ( epoch) ;
63+ let first_slot_in_epoch = cache . epoch_schedule . get_first_slot_in_epoch ( epoch) ;
6264 cache. slot_leader_at ( first_slot_in_epoch, Some ( root_bank) ) ;
6365 }
6466 cache
You can’t perform that action at this time.
0 commit comments