pub fn kick_stale_candidates(
			candidates: Vec<CandidateInfo<T::AccountId, BalanceOf<T>>>,
		) -> Vec<T::AccountId> {
			let now = frame_system::Pallet::<T>::block_number();
			let kick_threshold = T::KickThreshold::get();
			let new_candidates = candidates
				.into_iter()
				.filter_map(|c| {
					let last_block = <LastAuthoredBlock<T>>::get(&c.who);
					let since_last = now.saturating_sub(last_block);
					if since_last < kick_threshold ||
						Self::candidates().len() as u32 <= T::MinCandidates::get()
					{
						Some(c.who)
					} else {
						let outcome = Self::try_remove_candidate(&c.who);
						if let Err(why) = outcome {
							log::warn!("Failed to remove candidate {:?}", why);
							debug_assert!(false, "failed to remove candidate {:?}", why);
						}
						None
					}
				})
				.collect::<Vec<_>>();
			new_candidates
		}
/// Kicks out and candidates that did not produce a block in the kick threshold.
Kicks out and candidates that did not produce a block in the kick threshold.
Kicks out and candidates that did not produce a block in the kick threshold .
pub fn kick_stale_candidates(
			candidates: Vec<CandidateInfo<T::AccountId, BalanceOf<T>>>,
		) -> Vec<T::AccountId> {
			let now = frame_system::Pallet::<T>::block_number();
			let kick_threshold = T::KickThreshold::get();
			let new_candidates = candidates
				.into_iter()
				.filter_map(|c| {
					let last_block = <LastAuthoredBlock<T>>::get(&c.who);
					let since_last = now.saturating_sub(last_block);
					if since_last < kick_threshold ||
						Self::candidates().len() as u32 <= T::MinCandidates::get()
					{
						Some(c.who)
					} else {
						let outcome = Self::try_remove_candidate(&c.who);
						if let Err(why) = outcome {
							log::warn!("Failed to remove candidate {:?}", why);
							debug_assert!(false, "failed to remove candidate {:?}", why);
						}
						None
					}
				})
				.collect::<Vec<_>>();
			new_candidates
		}
pub fn kick_stale_candidates ( candidates : Vec < CandidateInfo < T :: AccountId , BalanceOf < T > > > , ) -> Vec < T :: AccountId > { let now = frame_system :: Pallet :: < T > :: block_number ( ) ; let kick_threshold = T :: KickThreshold :: get ( ) ; let new_candidates = candidates . into_iter ( ) . filter_map ( | c | { let last_block = < LastAuthoredBlock < T > > :: get ( & c . who ) ; let since_last = now . saturating_sub ( last_block ) ; if since_last < kick_threshold || Self :: candidates ( ) . len ( ) as u32 <= T :: MinCandidates :: get ( ) { Some ( c . who ) } else { let outcome = Self :: try_remove_candidate ( & c . who ) ; if let Err ( why ) = outcome { log :: warn ! ( " " why ) ; debug_assert ! ( false " " why ) ; } None } } ) . collect :: < Vec < _ > > ( ) ; new_candidates }
Kicks out and candidates that did not produce a block in the kick threshold.
Kicks out and candidates that did not produce a block in the kick threshold .
candidates
Vec<CandidateInfo<T::AccountId, BalanceOf<T>>>