fn should_send_confirmation(
        &self,
        vhash: &C::Hash,
        timestamp: Timestamp,
        state: &State<C>,
    ) -> bool {
        let unit = state.unit(vhash);
        // If it's not a proposal, the sender is faulty, or we are, don't send a confirmation.
        if unit.creator == self.vidx || self.is_faulty(state) || !state.is_correct_proposal(unit) {
            return false;
        }
        let r_id = state::round_id(timestamp, self.round_exp(state, timestamp));
        if unit.timestamp != r_id {
            trace!(
                %unit.timestamp, %r_id,
                "not confirming proposal: wrong round",
            );
            return false;
        }
        if unit.timestamp > timestamp {
            error!(
                %unit.timestamp, %timestamp,
                "added a unit with a future timestamp, should never happen"
            );
            return false;
        }
        if let Some(unit) = self.latest_unit(state) {
            if unit.panorama.sees_correct(state, vhash) {
                error!(%vhash, "called on_new_unit with already confirmed proposal");
                return false; // We already sent a confirmation.
            }
        }
        let earliest_unit_time = self.earliest_unit_time(state);
        if timestamp < earliest_unit_time {
            warn!(
                %earliest_unit_time, %timestamp,
                "earliest_unit_time is greater than current time stamp"
            );
            return false;
        }
        true
    }
/// Returns whether the incoming message is a proposal that we need to send a confirmation for.
Returns whether the incoming message is a proposal that we need to send a confirmation for.
Returns whether the incoming message is a proposal that we need to send a confirmation for .
fn should_send_confirmation(
        &self,
        vhash: &C::Hash,
        timestamp: Timestamp,
        state: &State<C>,
    ) -> bool {
        let unit = state.unit(vhash);
        // If it's not a proposal, the sender is faulty, or we are, don't send a confirmation.
        if unit.creator == self.vidx || self.is_faulty(state) || !state.is_correct_proposal(unit) {
            return false;
        }
        let r_id = state::round_id(timestamp, self.round_exp(state, timestamp));
        if unit.timestamp != r_id {
            trace!(
                %unit.timestamp, %r_id,
                "not confirming proposal: wrong round",
            );
            return false;
        }
        if unit.timestamp > timestamp {
            error!(
                %unit.timestamp, %timestamp,
                "added a unit with a future timestamp, should never happen"
            );
            return false;
        }
        if let Some(unit) = self.latest_unit(state) {
            if unit.panorama.sees_correct(state, vhash) {
                error!(%vhash, "called on_new_unit with already confirmed proposal");
                return false; // We already sent a confirmation.
            }
        }
        let earliest_unit_time = self.earliest_unit_time(state);
        if timestamp < earliest_unit_time {
            warn!(
                %earliest_unit_time, %timestamp,
                "earliest_unit_time is greater than current time stamp"
            );
            return false;
        }
        true
    }
fn should_send_confirmation ( & self , vhash : & C :: Hash , timestamp : Timestamp , state : & State < C > , ) -> bool { let unit = state . unit ( vhash ) ; // If it's not a proposal, the sender is faulty, or we are, don't send a confirmation. if unit . creator == self . vidx || self . is_faulty ( state ) || ! state . is_correct_proposal ( unit ) { return false ; } let r_id = state :: round_id ( timestamp , self . round_exp ( state , timestamp ) ) ; if unit . timestamp != r_id { trace ! ( unit timestamp r_id " " ) ; return false ; } if unit . timestamp > timestamp { error ! ( unit timestamp timestamp " " ) ; return false ; } if let Some ( unit ) = self . latest_unit ( state ) { if unit . panorama . sees_correct ( state , vhash ) { error ! ( vhash " " ) ; return false ; // We already sent a confirmation. } } let earliest_unit_time = self . earliest_unit_time ( state ) ; if timestamp < earliest_unit_time { warn ! ( earliest_unit_time timestamp " " ) ; return false ; } true }
Returns whether the incoming message is a proposal that we need to send a confirmation for.
Returns whether the incoming message is a proposal that we need to send a confirmation for .
&self
vhash
&C::Hash
timestamp
Timestamp
state
&State<C>
&self
vhash
&C::Hash
timestamp
Timestamp
state
&State<C>