Rename leader_after_slots to leader_after_n_slots (#6459)
This commit is contained in:
parent
e2c316d2d0
commit
31e9074ae5
|
@ -283,7 +283,7 @@ impl BankingStage {
|
|||
let (leader_at_slot_offset, poh_has_bank, would_be_leader) = {
|
||||
let poh = poh_recorder.lock().unwrap();
|
||||
(
|
||||
poh.leader_after_slots(FORWARD_TRANSACTIONS_TO_LEADER_AT_SLOT_OFFSET),
|
||||
poh.leader_after_n_slots(FORWARD_TRANSACTIONS_TO_LEADER_AT_SLOT_OFFSET),
|
||||
poh.has_bank(),
|
||||
poh.would_be_leader(
|
||||
(FORWARD_TRANSACTIONS_TO_LEADER_AT_SLOT_OFFSET - 1) * DEFAULT_TICKS_PER_SLOT,
|
||||
|
@ -314,7 +314,7 @@ impl BankingStage {
|
|||
let next_leader = poh_recorder
|
||||
.lock()
|
||||
.unwrap()
|
||||
.leader_after_slots(FORWARD_TRANSACTIONS_TO_LEADER_AT_SLOT_OFFSET);
|
||||
.leader_after_n_slots(FORWARD_TRANSACTIONS_TO_LEADER_AT_SLOT_OFFSET);
|
||||
next_leader.map_or(Ok(()), |leader_pubkey| {
|
||||
let leader_addr = {
|
||||
cluster_info
|
||||
|
|
|
@ -100,14 +100,14 @@ impl PohRecorder {
|
|||
})
|
||||
}
|
||||
|
||||
pub fn leader_after_slots(&self, slots: u64) -> Option<Pubkey> {
|
||||
pub fn leader_after_n_slots(&self, slots: u64) -> Option<Pubkey> {
|
||||
let current_slot = self.tick_height.saturating_sub(1) / self.ticks_per_slot;
|
||||
self.leader_schedule_cache
|
||||
.slot_leader_at(current_slot + slots, None)
|
||||
}
|
||||
|
||||
pub fn next_slot_leader(&self) -> Option<Pubkey> {
|
||||
self.leader_after_slots(1)
|
||||
self.leader_after_n_slots(1)
|
||||
}
|
||||
|
||||
pub fn bank(&self) -> Option<Arc<Bank>> {
|
||||
|
|
Loading…
Reference in New Issue