/// Helper to verify the signature share
Helper to verify the signature share
Helper to verify the signature share
fn crypto_verify_signature_share(
        &self,
        id: &EcdsaMessageId,
        sig_inputs: &ThresholdEcdsaSigInputs,
        share: &EcdsaSigShare,
    ) -> EcdsaChangeSet {
        ThresholdEcdsaSigVerifier::verify_sig_share(
            &*self.crypto,
            share.signer_id,
            sig_inputs,
            &share.share,
        )
        .map_or_else(
            |error| {
                if error.is_replicated() {
                    self.metrics.sign_errors_inc("verify_sig_share_permanent");
                    vec![EcdsaChangeAction::HandleInvalid(
                        id.clone(),
                        format!(
                            "Share validation(permanent error): signer = {:?},
                              height = {:?}, request_id = {:?}, error = {:?}",
                            share.signer_id, share.requested_height, share.request_id, error
                        ),
                    )]
                } else {
                    // Defer in case of transient errors
                    debug!(
                        self.log,
                        "Share validation(transient error): signer = {:?},
                            height = {:?}, request_id = {:?}, error = {:?}",
                        share.signer_id,
                        share.requested_height,
                        share.request_id,
                        error
                    );
                    self.metrics.sign_errors_inc("verify_sig_share_transient");
                    Default::default()
                }
            },
            |()| {
                self.metrics.sign_metrics_inc("sig_shares_received");
                vec![EcdsaChangeAction::MoveToValidated(id.clone())]
            },
        )
    }
fn crypto_verify_signature_share ( & self , id : & EcdsaMessageId , sig_inputs : & ThresholdEcdsaSigInputs , share : & EcdsaSigShare , ) -> EcdsaChangeSet { ThresholdEcdsaSigVerifier :: verify_sig_share ( & * self . crypto , share . signer_id , sig_inputs , & share . share , ) . map_or_else ( | error | { if error . is_replicated ( ) { self . metrics . sign_errors_inc ( " " ) ; vec ! [ EcdsaChangeAction HandleInvalid ( id clone ( ) format ( " " share signer_id share requested_height share request_id error ) ) ] } else { // Defer in case of transient errors debug ! ( self log " " share signer_id share requested_height share request_id error ) ; self . metrics . sign_errors_inc ( " " ) ; Default :: default ( ) } } , | ( ) | { self . metrics . sign_metrics_inc ( " " ) ; vec ! [ EcdsaChangeAction MoveToValidated ( id clone ( ) ) ] } , ) }
Helper to verify the signature share
Helper to verify the signature share
&self
id
&EcdsaMessageId
sig_inputs
&ThresholdEcdsaSigInputs
share
&EcdsaSigShare