pub fn disable_index(i: usize) -> bool {
        let (fire_event, threshold_reached) = DisabledValidators::mutate(|disabled| {
            let i = i as u32;
            if let Err(index) = disabled.binary_search(&i) {
                let count = <Validators<T>>::decode_len().unwrap_or(0) as u32;
                let threshold = T::DisabledValidatorsThreshold::get() * count;
                disabled.insert(index, i);
                (true, disabled.len() as u32 > threshold)
            } else {
                (false, false)
            }
        });
        if fire_event {
            T::SessionHandler::on_disabled(i);
        }
        threshold_reached
    }
/// Disable the validator of index `i`.
///
/// Returns `true` if this causes a `DisabledValidatorsThreshold` of validators
/// to be already disabled.
Disable the validator of index `i`.
Returns `true` if this causes a `DisabledValidatorsThreshold` of validators
to be already disabled.
Disable the validator of index ` i ` . Returns ` true ` if this causes a ` DisabledValidatorsThreshold ` of validators to be already disabled .
pub fn disable_index(i: usize) -> bool {
        let (fire_event, threshold_reached) = DisabledValidators::mutate(|disabled| {
            let i = i as u32;
            if let Err(index) = disabled.binary_search(&i) {
                let count = <Validators<T>>::decode_len().unwrap_or(0) as u32;
                let threshold = T::DisabledValidatorsThreshold::get() * count;
                disabled.insert(index, i);
                (true, disabled.len() as u32 > threshold)
            } else {
                (false, false)
            }
        });
        if fire_event {
            T::SessionHandler::on_disabled(i);
        }
        threshold_reached
    }
pub fn disable_index ( i : usize ) -> bool { let ( fire_event , threshold_reached ) = DisabledValidators :: mutate ( | disabled | { let i = i as u32 ; if let Err ( index ) = disabled . binary_search ( & i ) { let count = < Validators < T > > :: decode_len ( ) . unwrap_or ( 0 ) as u32 ; let threshold = T :: DisabledValidatorsThreshold :: get ( ) * count ; disabled . insert ( index , i ) ; ( true , disabled . len ( ) as u32 > threshold ) } else { ( false , false ) } } ) ; if fire_event { T :: SessionHandler :: on_disabled ( i ) ; } threshold_reached }
Disable the validator of index `i`.
Disable the validator of index ` i ` .
i
usize
i
usize