fn send_dealing_support(
        &self,
        ecdsa_pool: &dyn EcdsaPool,
        block_reader: &dyn EcdsaBlockReader,
    ) -> EcdsaChangeSet {
        // TranscriptId -> TranscriptParams
        let mut trancript_param_map = BTreeMap::new();
        for transcript_params in block_reader.requested_transcripts() {
            trancript_param_map.insert(transcript_params.transcript_id(), transcript_params);
        }

        ecdsa_pool
            .validated()
            .signed_dealings()
            .filter(|(_, signed_dealing)| {
                let dealing = signed_dealing.get();
                !self.has_node_issued_dealing_support(
                    ecdsa_pool,
                    &dealing.idkg_dealing.transcript_id,
                    &dealing.idkg_dealing.dealer_id,
                    &self.node_id,
                )
            })
            .filter_map(|(id, signed_dealing)| {
                let dealing = signed_dealing.get();
                // Look up the transcript params for the dealing, and check if we
                // are a receiver for this dealing
                if let Some(transcript_params) =
                    trancript_param_map.get(&dealing.idkg_dealing.transcript_id)
                {
                    transcript_params
                        .receivers()
                        .position(self.node_id)
                        .map(|_| (id, transcript_params, dealing))
                } else {
                    self.metrics
                        .pre_sign_errors_inc("create_support_missing_transcript_params");
                    warn!(
                        self.log,
                        "Dealing support creation: transcript_param not found: dealer = {:?},
                          height = {:?}, transcript_id = {:?}",
                        dealing.idkg_dealing.dealer_id,
                        dealing.requested_height,
                        dealing.idkg_dealing.transcript_id,
                    );
                    None
                }
            })
            .map(|(id, transcript_params, dealing)| {
                self.crypto_create_dealing_support(&id, transcript_params, dealing)
            })
            .flatten()
            .collect()
    }
/// Sends out the signature share for the dealings received from peer
/// dealers
Sends out the signature share for the dealings received from peer
dealers
Sends out the signature share for the dealings received from peer dealers
fn send_dealing_support(
        &self,
        ecdsa_pool: &dyn EcdsaPool,
        block_reader: &dyn EcdsaBlockReader,
    ) -> EcdsaChangeSet {
        // TranscriptId -> TranscriptParams
        let mut trancript_param_map = BTreeMap::new();
        for transcript_params in block_reader.requested_transcripts() {
            trancript_param_map.insert(transcript_params.transcript_id(), transcript_params);
        }
        ecdsa_pool
            .validated()
            .signed_dealings()
            .filter(|(_, signed_dealing)| {
                let dealing = signed_dealing.get();
                !self.has_node_issued_dealing_support(
                    ecdsa_pool,
                    &dealing.idkg_dealing.transcript_id,
                    &dealing.idkg_dealing.dealer_id,
                    &self.node_id,
                )
            })
            .filter_map(|(id, signed_dealing)| {
                let dealing = signed_dealing.get();
                // Look up the transcript params for the dealing, and check if we
                // are a receiver for this dealing
                if let Some(transcript_params) =
                    trancript_param_map.get(&dealing.idkg_dealing.transcript_id)
                {
                    transcript_params
                        .receivers()
                        .position(self.node_id)
                        .map(|_| (id, transcript_params, dealing))
                } else {
                    self.metrics
                        .pre_sign_errors_inc("create_support_missing_transcript_params");
                    warn!(
                        self.log,
                        "Dealing support creation: transcript_param not found: dealer = {:?},
                          height = {:?}, transcript_id = {:?}",
                        dealing.idkg_dealing.dealer_id,
                        dealing.requested_height,
                        dealing.idkg_dealing.transcript_id,
                    );
                    None
                }
            })
            .map(|(id, transcript_params, dealing)| {
                self.crypto_create_dealing_support(&id, transcript_params, dealing)
            })
            .flatten()
            .collect()
    }
fn send_dealing_support ( & self , ecdsa_pool : & dyn EcdsaPool , block_reader : & dyn EcdsaBlockReader , ) -> EcdsaChangeSet { // TranscriptId -> TranscriptParams let mut trancript_param_map = BTreeMap :: new ( ) ; for transcript_params in block_reader . requested_transcripts ( ) { trancript_param_map . insert ( transcript_params . transcript_id ( ) , transcript_params ) ; } ecdsa_pool . validated ( ) . signed_dealings ( ) . filter ( | ( _ , signed_dealing ) | { let dealing = signed_dealing . get ( ) ; ! self . has_node_issued_dealing_support ( ecdsa_pool , & dealing . idkg_dealing . transcript_id , & dealing . idkg_dealing . dealer_id , & self . node_id , ) } ) . filter_map ( | ( id , signed_dealing ) | { let dealing = signed_dealing . get ( ) ; // Look up the transcript params for the dealing, and check if we // are a receiver for this dealing if let Some ( transcript_params ) = trancript_param_map . get ( & dealing . idkg_dealing . transcript_id ) { transcript_params . receivers ( ) . position ( self . node_id ) . map ( | _ | ( id , transcript_params , dealing ) ) } else { self . metrics . pre_sign_errors_inc ( " " ) ; warn ! ( self log " " dealing idkg_dealing dealer_id dealing requested_height dealing idkg_dealing transcript_id ) ; None } } ) . map ( | ( id , transcript_params , dealing ) | { self . crypto_create_dealing_support ( & id , transcript_params , dealing ) } ) . flatten ( ) . collect ( ) }
Sends out the signature share for the dealings received from peer
dealers
Sends out the signature share for the dealings received from peer dealers
&self
ecdsa_pool
&dyn EcdsaPool
block_reader
&dyn EcdsaBlockReader
&self
ecdsa_pool
&dyn EcdsaPool
block_reader
&dyn EcdsaBlockReader