fn construct_prevote(&self, last_round_state: &RoundState<H, N>) -> (H, E::BestChain) {
		let last_round_estimate = last_round_state
			.estimate
			.clone()
			.expect("Rounds only started when prior round completable; qed");

		let find_descendent_of = match self.primary_block {
			None => {
				// vote for best chain containing prior round-estimate.
				last_round_estimate.0
			},
			Some(ref primary_block) => {
				// we will vote for the best chain containing `p_hash` iff
				// the last round's prevote-GHOST included that block and
				// that block is a strict descendent of the last round-estimate that we are
				// aware of.
				let last_prevote_g = last_round_state
					.prevote_ghost
					.clone()
					.expect("Rounds only started when prior round completable; qed");

				// if the blocks are equal, we don't check ancestry.
				if primary_block == &last_prevote_g {
					primary_block.0.clone()
				} else if primary_block.1 >= last_prevote_g.1 {
					last_round_estimate.0
				} else {
					// from this point onwards, the number of the primary-broadcasted
					// block is less than the last prevote-GHOST's number.
					// if the primary block is in the ancestry of p-G we vote for the
					// best chain containing it.
					let &(ref p_hash, p_num) = primary_block;
					match self.env.ancestry(last_round_estimate.0.clone(), last_prevote_g.0.clone())
					{
						Ok(ancestry) => {
							let to_sub = p_num + N::one();

							let offset: usize = if last_prevote_g.1 < to_sub {
								0
							} else {
								(last_prevote_g.1 - to_sub).as_()
							};

							if ancestry.get(offset).map_or(false, |b| b == p_hash) {
								p_hash.clone()
							} else {
								last_round_estimate.0
							}
						},
						Err(crate::Error::NotDescendent) => {
							// This is only possible in case of massive equivocation
							warn!(target: "afg",
								"Possible case of massive equivocation: \
								last round prevote GHOST: {:?} is not a descendant of last round estimate: {:?}",
								last_prevote_g,
								last_round_estimate,
							);

							last_round_estimate.0
						},
					}
				}
			},
		};

		(find_descendent_of.clone(), self.env.best_chain_containing(find_descendent_of))
	}
// construct a prevote message based on local state.
construct a prevote message based on local state.
construct a prevote message based on local state .
fn construct_prevote(&self, last_round_state: &RoundState<H, N>) -> (H, E::BestChain) {
		let last_round_estimate = last_round_state
			.estimate
			.clone()
			.expect("Rounds only started when prior round completable; qed");
		let find_descendent_of = match self.primary_block {
			None => {
				// vote for best chain containing prior round-estimate.
				last_round_estimate.0
			},
			Some(ref primary_block) => {
				// we will vote for the best chain containing `p_hash` iff
				// the last round's prevote-GHOST included that block and
				// that block is a strict descendent of the last round-estimate that we are
				// aware of.
				let last_prevote_g = last_round_state
					.prevote_ghost
					.clone()
					.expect("Rounds only started when prior round completable; qed");
				// if the blocks are equal, we don't check ancestry.
				if primary_block == &last_prevote_g {
					primary_block.0.clone()
				} else if primary_block.1 >= last_prevote_g.1 {
					last_round_estimate.0
				} else {
					// from this point onwards, the number of the primary-broadcasted
					// block is less than the last prevote-GHOST's number.
					// if the primary block is in the ancestry of p-G we vote for the
					// best chain containing it.
					let &(ref p_hash, p_num) = primary_block;
					match self.env.ancestry(last_round_estimate.0.clone(), last_prevote_g.0.clone())
					{
						Ok(ancestry) => {
							let to_sub = p_num + N::one();
							let offset: usize = if last_prevote_g.1 < to_sub {
								0
							} else {
								(last_prevote_g.1 - to_sub).as_()
							};
							if ancestry.get(offset).map_or(false, |b| b == p_hash) {
								p_hash.clone()
							} else {
								last_round_estimate.0
							}
						},
						Err(crate::Error::NotDescendent) => {
							// This is only possible in case of massive equivocation
							warn!(target: "afg",
								"Possible case of massive equivocation: \
								last round prevote GHOST: {:?} is not a descendant of last round estimate: {:?}",
								last_prevote_g,
								last_round_estimate,
							);
							last_round_estimate.0
						},
					}
				}
			},
		};
		(find_descendent_of.clone(), self.env.best_chain_containing(find_descendent_of))
	}
fn construct_prevote ( & self , last_round_state : & RoundState < H , N > ) -> ( H , E :: BestChain ) { let last_round_estimate = last_round_state . estimate . clone ( ) . expect ( " " ) ; let find_descendent_of = match self . primary_block { None => { // vote for best chain containing prior round-estimate. last_round_estimate . 0 } , Some ( ref primary_block ) => { // we will vote for the best chain containing `p_hash` iff // the last round's prevote-GHOST included that block and // that block is a strict descendent of the last round-estimate that we are // aware of. let last_prevote_g = last_round_state . prevote_ghost . clone ( ) . expect ( " " ) ; // if the blocks are equal, we don't check ancestry. if primary_block == & last_prevote_g { primary_block . 0 . clone ( ) } else if primary_block . 1 >= last_prevote_g . 1 { last_round_estimate . 0 } else { // from this point onwards, the number of the primary-broadcasted // block is less than the last prevote-GHOST's number. // if the primary block is in the ancestry of p-G we vote for the // best chain containing it. let & ( ref p_hash , p_num ) = primary_block ; match self . env . ancestry ( last_round_estimate . 0 . clone ( ) , last_prevote_g . 0 . clone ( ) ) { Ok ( ancestry ) => { let to_sub = p_num + N :: one ( ) ; let offset : usize = if last_prevote_g . 1 < to_sub { 0 } else { ( last_prevote_g . 1 - to_sub ) . as_ ( ) } ; if ancestry . get ( offset ) . map_or ( false , | b | b == p_hash ) { p_hash . clone ( ) } else { last_round_estimate . 0 } } , Err ( crate :: Error :: NotDescendent ) => { // This is only possible in case of massive equivocation warn ! ( target " " " \
 " last_prevote_g last_round_estimate ) ; last_round_estimate . 0 } , } } } , } ; ( find_descendent_of . clone ( ) , self . env . best_chain_containing ( find_descendent_of ) ) }
construct a prevote message based on local state.
construct a prevote message based on local state .
&self
last_round_state
&RoundState<H, N>
&self
last_round_state
&RoundState<H, N>