pub fn should_retransmit_and_persist(
    shred: &Shred,
    bank: Option<Arc<Bank>>,
    leader_schedule_cache: &Arc<LeaderScheduleCache>,
    my_pubkey: &Pubkey,
    root: u64,
    shred_version: u16,
) -> bool {
    let slot_leader_pubkey = match bank {
        None => leader_schedule_cache.slot_leader_at(shred.slot(), None),
        Some(bank) => leader_schedule_cache.slot_leader_at(shred.slot(), Some(&bank)),
    };
    if let Some(leader_id) = slot_leader_pubkey {
        if leader_id == *my_pubkey {
            inc_new_counter_debug!("streamer-recv_window-circular_transmission", 1);
            false
        } else if !verify_shred_slot(shred, root) {
            inc_new_counter_debug!("streamer-recv_window-outdated_transmission", 1);
            false
        } else if shred.version() != shred_version {
            inc_new_counter_debug!("streamer-recv_window-incorrect_shred_version", 1);
            false
        } else if shred.index() >= MAX_DATA_SHREDS_PER_SLOT as u32 {
            inc_new_counter_warn!("streamer-recv_window-shred_index_overrun", 1);
            false
        } else {
            true
        }
    } else {
        inc_new_counter_debug!("streamer-recv_window-unknown_leader", 1);
        false
    }
}
/// drop shreds that are from myself or not from the correct leader for the
/// shred's slot
drop shreds that are from myself or not from the correct leader for the
shred's slot
drop shreds that are from myself or not from the correct leader for the shred ' s slot
pub fn should_retransmit_and_persist(
    shred: &Shred,
    bank: Option<Arc<Bank>>,
    leader_schedule_cache: &Arc<LeaderScheduleCache>,
    my_pubkey: &Pubkey,
    root: u64,
    shred_version: u16,
) -> bool {
    let slot_leader_pubkey = match bank {
        None => leader_schedule_cache.slot_leader_at(shred.slot(), None),
        Some(bank) => leader_schedule_cache.slot_leader_at(shred.slot(), Some(&bank)),
    };
    if let Some(leader_id) = slot_leader_pubkey {
        if leader_id == *my_pubkey {
            inc_new_counter_debug!("streamer-recv_window-circular_transmission", 1);
            false
        } else if !verify_shred_slot(shred, root) {
            inc_new_counter_debug!("streamer-recv_window-outdated_transmission", 1);
            false
        } else if shred.version() != shred_version {
            inc_new_counter_debug!("streamer-recv_window-incorrect_shred_version", 1);
            false
        } else if shred.index() >= MAX_DATA_SHREDS_PER_SLOT as u32 {
            inc_new_counter_warn!("streamer-recv_window-shred_index_overrun", 1);
            false
        } else {
            true
        }
    } else {
        inc_new_counter_debug!("streamer-recv_window-unknown_leader", 1);
        false
    }
}
pub fn should_retransmit_and_persist ( shred : & Shred , bank : Option < Arc < Bank > > , leader_schedule_cache : & Arc < LeaderScheduleCache > , my_pubkey : & Pubkey , root : u64 , shred_version : u16 , ) -> bool { let slot_leader_pubkey = match bank { None => leader_schedule_cache . slot_leader_at ( shred . slot ( ) , None ) , Some ( bank ) => leader_schedule_cache . slot_leader_at ( shred . slot ( ) , Some ( & bank ) ) , } ; if let Some ( leader_id ) = slot_leader_pubkey { if leader_id == * my_pubkey { inc_new_counter_debug ! ( " " 1 ) ; false } else if ! verify_shred_slot ( shred , root ) { inc_new_counter_debug ! ( " " 1 ) ; false } else if shred . version ( ) != shred_version { inc_new_counter_debug ! ( " " 1 ) ; false } else if shred . index ( ) >= MAX_DATA_SHREDS_PER_SLOT as u32 { inc_new_counter_warn ! ( " " 1 ) ; false } else { true } } else { inc_new_counter_debug ! ( " " 1 ) ; false } }
drop shreds that are from myself or not from the correct leader for the
shred's slot
drop shreds that are from myself or not from the correct leader for the shred ' s slot
shred
&Shred
bank
Option<Arc<Bank>>
leader_schedule_cache
&Arc<LeaderScheduleCache>
my_pubkey
&Pubkey
root
u64
shred_version
u16
shred
&Shred
bank
Option<Arc<Bank>>
leader_schedule_cache
&Arc<LeaderScheduleCache>
my_pubkey
&Pubkey
root
u64
shred_version
u16