pub fn dkg_summary_block(&self, block: &Block) -> Option<Block> {
        if block.payload.is_summary() {
            return Some(block.clone());
        }

        let summary_block = self.cache.summary_block();
        let start_height = block.payload.as_ref().dkg_interval_start_height();

        match summary_block.height().cmp(&start_height) {
            Ordering::Equal => {
                // Since block is extending a notarized chain, by our safety assumption it must
                // extend the finalized chain, so the finalized block in the cache is the
                // correct summary.
                Some(summary_block)
            }
            Ordering::Less => {
                // summary block is not finalized yet, so we search the chain for the summary
                // block
                self.chain_iterator(block.clone())
                    .find(|b| b.height == start_height)
            }
            Ordering::Greater => None,
        }
    }
/// Returns the DKG summary block for the given *valid* block (which means
/// it extends a notarized chain). Returns None if the DKG summary block
/// cannot be found.
Returns the DKG summary block for the given *valid* block (which means
it extends a notarized chain). Returns None if the DKG summary block
cannot be found.
Returns the DKG summary block for the given * valid * block ( which means it extends a notarized chain ) . Returns None if the DKG summary block cannot be found .
pub fn dkg_summary_block(&self, block: &Block) -> Option<Block> {
        if block.payload.is_summary() {
            return Some(block.clone());
        }
        let summary_block = self.cache.summary_block();
        let start_height = block.payload.as_ref().dkg_interval_start_height();
        match summary_block.height().cmp(&start_height) {
            Ordering::Equal => {
                // Since block is extending a notarized chain, by our safety assumption it must
                // extend the finalized chain, so the finalized block in the cache is the
                // correct summary.
                Some(summary_block)
            }
            Ordering::Less => {
                // summary block is not finalized yet, so we search the chain for the summary
                // block
                self.chain_iterator(block.clone())
                    .find(|b| b.height == start_height)
            }
            Ordering::Greater => None,
        }
    }
pub fn dkg_summary_block ( & self , block : & Block ) -> Option < Block > { if block . payload . is_summary ( ) { return Some ( block . clone ( ) ) ; } let summary_block = self . cache . summary_block ( ) ; let start_height = block . payload . as_ref ( ) . dkg_interval_start_height ( ) ; match summary_block . height ( ) . cmp ( & start_height ) { Ordering :: Equal => { // Since block is extending a notarized chain, by our safety assumption it must // extend the finalized chain, so the finalized block in the cache is the // correct summary. Some ( summary_block ) } Ordering :: Less => { // summary block is not finalized yet, so we search the chain for the summary // block self . chain_iterator ( block . clone ( ) ) . find ( | b | b . height == start_height ) } Ordering :: Greater => None , } }
Returns the DKG summary block for the given *valid* block (which means
it extends a notarized chain).
Returns the DKG summary block for the given * valid * block ( which means it extends a notarized chain ) .
&self
block
&Block
&self
block
&Block