/// If this node is a member of the notary group for the current round,
/// attempt to find the best blocks that we can notarize, and notarize them.
/// Else, do nothing.
If this node is a member of the notary group for the current round,
attempt to find the best blocks that we can notarize, and notarize them.
Else, do nothing.
If this node is a member of the notary group for the current round attempt to find the best blocks that we can notarize and notarize them . Else do nothing .
pub fn on_state_change(&self, pool: &PoolReader<'_>) -> Vec<NotarizationShare> {
        trace!(self.log, "on_state_change");
        let notarized_height = pool.get_notarized_height();
        let mut notarization_shares = Vec::new();
        if let Some(previous_beacon) = pool.get_random_beacon(notarized_height) {
            if !self.is_notary(pool, &previous_beacon) {
                return notarization_shares;
            }
            let height = notarized_height.increment();
            for proposal in find_lowest_ranked_proposals(pool, height) {
                if let Some(elapsed) = self.time_to_notarize(pool, height, proposal.rank()) {
                    if !self.is_proposal_already_notarized_by_me(pool, &proposal) {
                        let block = proposal.as_ref();
                        if let Some(s) = self.notarize_block(pool, block) {
                            self.metrics.report_notarization(block, elapsed);
                            notarization_shares.push(s);
                        }
                    }
                }
            }
        }
        notarization_shares
    }
pub fn on_state_change ( & self , pool : & PoolReader < ' _ > ) -> Vec < NotarizationShare > { trace ! ( self log " " ) ; let notarized_height = pool . get_notarized_height ( ) ; let mut notarization_shares = Vec :: new ( ) ; if let Some ( previous_beacon ) = pool . get_random_beacon ( notarized_height ) { if ! self . is_notary ( pool , & previous_beacon ) { return notarization_shares ; } let height = notarized_height . increment ( ) ; for proposal in find_lowest_ranked_proposals ( pool , height ) { if let Some ( elapsed ) = self . time_to_notarize ( pool , height , proposal . rank ( ) ) { if ! self . is_proposal_already_notarized_by_me ( pool , & proposal ) { let block = proposal . as_ref ( ) ; if let Some ( s ) = self . notarize_block ( pool , block ) { self . metrics . report_notarization ( block , elapsed ) ; notarization_shares . push ( s ) ; } } } } } notarization_shares }
If this node is a member of the notary group for the current round,
attempt to find the best blocks that we can notarize, and notarize them.
If this node is a member of the notary group for the current round attempt to find the best blocks that we can notarize and notarize them .
&self
pool
&PoolReader<'_>