// Returns true if this is the first time receiving a shred for `shred_slot`.
Returns true if this is the first time receiving a shred for `shred_slot`.
Returns true if this is the first time receiving a shred for ` shred_slot ` .
fn check_if_first_shred_received(
    shred_slot: Slot,
    first_shreds_received: &Mutex<BTreeSet<Slot>>,
    root_bank: &Bank,
) -> bool {
    if shred_slot <= root_bank.slot() {
        return false;
    }
    let mut first_shreds_received_locked = first_shreds_received.lock().unwrap();
    if first_shreds_received_locked.insert(shred_slot) {
        datapoint_info!("retransmit-first-shred", ("slot", shred_slot, i64));
        if first_shreds_received_locked.len() > 100 {
            *first_shreds_received_locked =
                first_shreds_received_locked.split_off(&(root_bank.slot() + 1));
        }
        true
    } else {
        false
    }
}
fn check_if_first_shred_received ( shred_slot : Slot , first_shreds_received : & Mutex < BTreeSet < Slot > > , root_bank : & Bank , ) -> bool { if shred_slot <= root_bank . slot ( ) { return false ; } let mut first_shreds_received_locked = first_shreds_received . lock ( ) . unwrap ( ) ; if first_shreds_received_locked . insert ( shred_slot ) { datapoint_info ! ( " " ( " " shred_slot i64 ) ) ; if first_shreds_received_locked . len ( ) > 100 { * first_shreds_received_locked = first_shreds_received_locked . split_off ( & ( root_bank . slot ( ) + 1 ) ) ; } true } else { false } }
Returns true if this is the first time receiving a shred for `shred_slot`.
Returns true if this is the first time receiving a shred for ` shred_slot ` .
shred_slot
Slot
first_shreds_received
&Mutex<BTreeSet<Slot>>
root_bank
&Bank