pub fn evaluate_misbehavior<B: Codec, H: Codec + Copy>(
	misbehaved: &AuthorityId,
	parent_hash: H,
	kind: &MisbehaviorKind<H>,
) -> bool {
	match *kind {
		MisbehaviorKind::BftDoublePrepare(round, (h_1, ref s_1), (h_2, ref s_2)) => {
			s_1 != s_2 &&
			check_message_sig::<B, H>(prepare::<B, H>(parent_hash, round, h_1), s_1, misbehaved) &&
			check_message_sig::<B, H>(prepare::<B, H>(parent_hash, round, h_2), s_2, misbehaved)
		}
		MisbehaviorKind::BftDoubleCommit(round, (h_1, ref s_1), (h_2, ref s_2)) => {
			s_1 != s_2 &&
			check_message_sig::<B, H>(commit::<B, H>(parent_hash, round, h_1), s_1, misbehaved) &&
			check_message_sig::<B, H>(commit::<B, H>(parent_hash, round, h_2), s_2, misbehaved)
		}
	}
}
/// Evaluate misbehavior.
///
/// Doesn't check that the header hash in question is
/// valid or whether the misbehaving authority was part of
/// the set at that block.
Evaluate misbehavior.
Doesn't check that the header hash in question is
valid or whether the misbehaving authority was part of
the set at that block.
Evaluate misbehavior . Doesn ' t check that the header hash in question is valid or whether the misbehaving authority was part of the set at that block .
pub fn evaluate_misbehavior<B: Codec, H: Codec + Copy>(
	misbehaved: &AuthorityId,
	parent_hash: H,
	kind: &MisbehaviorKind<H>,
) -> bool {
	match *kind {
		MisbehaviorKind::BftDoublePrepare(round, (h_1, ref s_1), (h_2, ref s_2)) => {
			s_1 != s_2 &&
			check_message_sig::<B, H>(prepare::<B, H>(parent_hash, round, h_1), s_1, misbehaved) &&
			check_message_sig::<B, H>(prepare::<B, H>(parent_hash, round, h_2), s_2, misbehaved)
		}
		MisbehaviorKind::BftDoubleCommit(round, (h_1, ref s_1), (h_2, ref s_2)) => {
			s_1 != s_2 &&
			check_message_sig::<B, H>(commit::<B, H>(parent_hash, round, h_1), s_1, misbehaved) &&
			check_message_sig::<B, H>(commit::<B, H>(parent_hash, round, h_2), s_2, misbehaved)
		}
	}
}
pub fn evaluate_misbehavior < B : Codec , H : Codec + Copy > ( misbehaved : & AuthorityId , parent_hash : H , kind : & MisbehaviorKind < H > , ) -> bool { match * kind { MisbehaviorKind :: BftDoublePrepare ( round , ( h_1 , ref s_1 ) , ( h_2 , ref s_2 ) ) => { s_1 != s_2 && check_message_sig :: < B , H > ( prepare :: < B , H > ( parent_hash , round , h_1 ) , s_1 , misbehaved ) && check_message_sig :: < B , H > ( prepare :: < B , H > ( parent_hash , round , h_2 ) , s_2 , misbehaved ) } MisbehaviorKind :: BftDoubleCommit ( round , ( h_1 , ref s_1 ) , ( h_2 , ref s_2 ) ) => { s_1 != s_2 && check_message_sig :: < B , H > ( commit :: < B , H > ( parent_hash , round , h_1 ) , s_1 , misbehaved ) && check_message_sig :: < B , H > ( commit :: < B , H > ( parent_hash , round , h_2 ) , s_2 , misbehaved ) } } }
Evaluate misbehavior.
Evaluate misbehavior .
misbehaved
&AuthorityId
parent_hash
H
kind
&MisbehaviorKind<H>
misbehaved
&AuthorityId
parent_hash
H
kind
&MisbehaviorKind<H>