pub fn should_retransmit_and_persist(
    blob: &Blob,
    bank: Option<Arc<Bank>>,
    leader_schedule_cache: &Arc<LeaderScheduleCache>,
    my_pubkey: &Pubkey,
) -> bool {
    let slot_leader_pubkey = match bank {
        None => leader_schedule_cache.slot_leader_at(blob.slot(), None),
        Some(bank) => leader_schedule_cache.slot_leader_at(blob.slot(), Some(&bank)),
    };

    if blob.id() == *my_pubkey {
        inc_new_counter_debug!("streamer-recv_window-circular_transmission", 1);
        false
    } else if slot_leader_pubkey == None {
        inc_new_counter_debug!("streamer-recv_window-unknown_leader", 1);
        false
    } else if slot_leader_pubkey != Some(blob.id()) {
        inc_new_counter_debug!("streamer-recv_window-wrong_leader", 1);
        false
    } else {
        // At this point, slot_leader_id == blob.id() && blob.id() != *my_id, so
        // the blob is valid to process
        true
    }
}
/// drop blobs that are from myself or not from the correct leader for the
/// blob's slot
drop blobs that are from myself or not from the correct leader for the
blob's slot
drop blobs that are from myself or not from the correct leader for the blob ' s slot
pub fn should_retransmit_and_persist(
    blob: &Blob,
    bank: Option<Arc<Bank>>,
    leader_schedule_cache: &Arc<LeaderScheduleCache>,
    my_pubkey: &Pubkey,
) -> bool {
    let slot_leader_pubkey = match bank {
        None => leader_schedule_cache.slot_leader_at(blob.slot(), None),
        Some(bank) => leader_schedule_cache.slot_leader_at(blob.slot(), Some(&bank)),
    };
    if blob.id() == *my_pubkey {
        inc_new_counter_debug!("streamer-recv_window-circular_transmission", 1);
        false
    } else if slot_leader_pubkey == None {
        inc_new_counter_debug!("streamer-recv_window-unknown_leader", 1);
        false
    } else if slot_leader_pubkey != Some(blob.id()) {
        inc_new_counter_debug!("streamer-recv_window-wrong_leader", 1);
        false
    } else {
        // At this point, slot_leader_id == blob.id() && blob.id() != *my_id, so
        // the blob is valid to process
        true
    }
}
pub fn should_retransmit_and_persist ( blob : & Blob , bank : Option < Arc < Bank > > , leader_schedule_cache : & Arc < LeaderScheduleCache > , my_pubkey : & Pubkey , ) -> bool { let slot_leader_pubkey = match bank { None => leader_schedule_cache . slot_leader_at ( blob . slot ( ) , None ) , Some ( bank ) => leader_schedule_cache . slot_leader_at ( blob . slot ( ) , Some ( & bank ) ) , } ; if blob . id ( ) == * my_pubkey { inc_new_counter_debug ! ( " " 1 ) ; false } else if slot_leader_pubkey == None { inc_new_counter_debug ! ( " " 1 ) ; false } else if slot_leader_pubkey != Some ( blob . id ( ) ) { inc_new_counter_debug ! ( " " 1 ) ; false } else { // At this point, slot_leader_id == blob.id() && blob.id() != *my_id, so // the blob is valid to process true } }
drop blobs that are from myself or not from the correct leader for the
blob's slot
drop blobs that are from myself or not from the correct leader for the blob ' s slot
blob
&Blob
bank
Option<Arc<Bank>>
leader_schedule_cache
&Arc<LeaderScheduleCache>
my_pubkey
&Pubkey
blob
&Blob
bank
Option<Arc<Bank>>
leader_schedule_cache
&Arc<LeaderScheduleCache>
my_pubkey
&Pubkey