/// Check a commit. If it's valid, import all the votes into the round as well.
/// Returns the finalized base if it checks out.
Check a commit. If it's valid, import all the votes into the round as well.
Returns the finalized base if it checks out.
Check a commit . If it ' s valid import all the votes into the round as well . Returns the finalized base if it checks out .
pub(super) fn check_and_import_from_commit(
		&mut self,
		commit: &Commit<H, N, E::Signature, E::Id>,
	) -> Result<Option<(H, N)>, E::Error> {
		let base = validate_commit(commit, self.voters(), &*self.env)?.ghost;
		if base.is_none() {
			return Ok(None)
		}
		for SignedPrecommit { precommit, signature, id } in commit.precommits.iter().cloned() {
			let import_result =
				self.votes.import_precommit(&*self.env, precommit, id, signature)?;
			if let ImportResult { equivocation: Some(e), .. } = import_result {
				self.env.precommit_equivocation(self.round_number(), e);
			}
		}
		Ok(base)
	}
pub ( super ) fn check_and_import_from_commit ( & mut self , commit : & Commit < H , N , E :: Signature , E :: Id > , ) -> Result < Option < ( H , N ) > , E :: Error > { let base = validate_commit ( commit , self . voters ( ) , & * self . env ) ? . ghost ; if base . is_none ( ) { return Ok ( None ) } for SignedPrecommit { precommit , signature , id } in commit . precommits . iter ( ) . cloned ( ) { let import_result = self . votes . import_precommit ( & * self . env , precommit , id , signature ) ? ; if let ImportResult { equivocation : Some ( e ) , .. } = import_result { self . env . precommit_equivocation ( self . round_number ( ) , e ) ; } } Ok ( base ) }
Check a commit.
Check a commit .
&mut self
commit
&Commit<H, N, E::Signature, E::Id>