pub(crate) fn add_evidence(&mut self, evidence: Evidence<C>) -> bool {
        if TODO_ENDORSEMENT_EVIDENCE_DISABLED && matches!(evidence, Evidence::Endorsements { .. }) {
            return false;
        }
        let idx = evidence.perpetrator();
        match self.faults.get(&idx) {
            Some(&Fault::Banned) | Some(&Fault::Direct(_)) => return false,
            None | Some(&Fault::Indirect) => (),
        }
        // TODO: Should use Display, not Debug!
        trace!(?evidence, "marking validator #{} as faulty", idx.0);
        self.faults.insert(idx, Fault::Direct(evidence));
        self.panorama[idx] = Observation::Faulty;
        true
    }
/// Adds direct evidence proving a validator to be faulty, unless that validators is already
/// banned or we already have other direct evidence. This must only be called with valid
/// evidence (see `Evidence::validate`). Returns `false` if the evidence was not added because
/// the perpetrator is banned or we already have evidence against them.
Adds direct evidence proving a validator to be faulty, unless that validators is already
banned or we already have other direct evidence. This must only be called with valid
evidence . Returns `false` if the evidence was not added because
the perpetrator is banned or we already have evidence against them.
Adds direct evidence proving a validator to be faulty unless that validators is already banned or we already have other direct evidence . This must only be called with valid evidence . Returns ` false ` if the evidence was not added because the perpetrator is banned or we already have evidence against them .
pub(crate) fn add_evidence(&mut self, evidence: Evidence<C>) -> bool {
        if TODO_ENDORSEMENT_EVIDENCE_DISABLED && matches!(evidence, Evidence::Endorsements { .. }) {
            return false;
        }
        let idx = evidence.perpetrator();
        match self.faults.get(&idx) {
            Some(&Fault::Banned) | Some(&Fault::Direct(_)) => return false,
            None | Some(&Fault::Indirect) => (),
        }
        // TODO: Should use Display, not Debug!
        trace!(?evidence, "marking validator #{} as faulty", idx.0);
        self.faults.insert(idx, Fault::Direct(evidence));
        self.panorama[idx] = Observation::Faulty;
        true
    }
pub ( crate ) fn add_evidence ( & mut self , evidence : Evidence < C > ) -> bool { if TODO_ENDORSEMENT_EVIDENCE_DISABLED && matches ! ( evidence Evidence Endorsements { } ) { return false ; } let idx = evidence . perpetrator ( ) ; match self . faults . get ( & idx ) { Some ( & Fault :: Banned ) | Some ( & Fault :: Direct ( _ ) ) => return false , None | Some ( & Fault :: Indirect ) => ( ) , } // TODO: Should use Display, not Debug! trace ! ( evidence " " idx 0 ) ; self . faults . insert ( idx , Fault :: Direct ( evidence ) ) ; self . panorama [ idx ] = Observation :: Faulty ; true }
Adds direct evidence proving a validator to be faulty, unless that validators is already
banned or we already have other direct evidence.
Adds direct evidence proving a validator to be faulty unless that validators is already banned or we already have other direct evidence .
&mut self
evidence
Evidence<C>
&mut self
evidence
Evidence<C>