pub fn is_build_required<N>(cht_size: u64, block_num: N) -> Option<N>
	where
		N: Clone + SimpleArithmetic,
{
	let block_cht_num = block_to_cht_number(cht_size, block_num.clone())?;
	let two = N::one() + N::one();
	if block_cht_num < two {
		return None;
	}
	let cht_start = start_number(cht_size, block_cht_num.clone());
	if cht_start != block_num {
		return None;
	}

	Some(block_cht_num - two)
}
/// Returns Some(cht_number) if CHT is need to be built when the block with given number is canonized.
Returns Some(cht_number) if CHT is need to be built when the block with given number is canonized.
Returns Some ( cht_number ) if CHT is need to be built when the block with given number is canonized .
pub fn is_build_required<N>(cht_size: u64, block_num: N) -> Option<N>
	where
		N: Clone + SimpleArithmetic,
{
	let block_cht_num = block_to_cht_number(cht_size, block_num.clone())?;
	let two = N::one() + N::one();
	if block_cht_num < two {
		return None;
	}
	let cht_start = start_number(cht_size, block_cht_num.clone());
	if cht_start != block_num {
		return None;
	}
	Some(block_cht_num - two)
}
pub fn is_build_required < N > ( cht_size : u64 , block_num : N ) -> Option < N > where N : Clone + SimpleArithmetic , { let block_cht_num = block_to_cht_number ( cht_size , block_num . clone ( ) ) ? ; let two = N :: one ( ) + N :: one ( ) ; if block_cht_num < two { return None ; } let cht_start = start_number ( cht_size , block_cht_num . clone ( ) ) ; if cht_start != block_num { return None ; } Some ( block_cht_num - two ) }
Returns Some(cht_number) if CHT is need to be built when the block with given number is canonized.
Returns Some ( cht_number ) if CHT is need to be built when the block with given number is canonized .
cht_size
u64
block_num
N
cht_size
u64
block_num
N