Fix slot index used while calculating leader schedule
- slot_leader_at() was using absolute slot number instead of index in the epoch
This commit is contained in:
parent
1c44b738fe
commit
30bccc0c68
|
@ -36,8 +36,9 @@ pub fn slot_leader(bank: &Bank) -> Pubkey {
|
|||
|
||||
/// Return the leader for the given slot.
|
||||
pub fn slot_leader_at(slot: u64, bank: &Bank) -> Pubkey {
|
||||
let epoch = slot / bank.slots_per_epoch();
|
||||
slot_leader_by(bank, |_, _, _| (slot, epoch))
|
||||
slot_leader_by(bank, |_, _, _| {
|
||||
(slot % bank.slots_per_epoch(), slot / bank.slots_per_epoch())
|
||||
})
|
||||
}
|
||||
|
||||
/// Return the epoch height and slot index of the slot before the current slot.
|
||||
|
|
Loading…
Reference in New Issue