pub(crate) fn seen_endorsed(&self, pan: &Panorama<C>) -> BTreeSet<C::Hash> {
        if !ENABLE_ENDORSEMENTS {
            return Default::default();
        };
        // First we collect all units that were already seen as endorsed by earlier units.
        let mut result: BTreeSet<C::Hash> = pan
            .iter_correct_hashes()
            .flat_map(|hash| self.unit(hash).endorsed.iter().cloned())
            .collect();
        // Now add all remaining endorsed units. Since the pan.sees check is expensive, do it only
        // for the ones that are actually new.
        for hash in self.endorsements.keys() {
            if !result.contains(hash) && pan.sees(self, hash) {
                result.insert(*hash);
            }
        }
        result
    }
/// Returns the set of units (by hash) that are endorsed and seen from the panorama.
Returns the set of units (by hash) that are endorsed and seen from the panorama.
Returns the set of units ( by hash ) that are endorsed and seen from the panorama .
pub(crate) fn seen_endorsed(&self, pan: &Panorama<C>) -> BTreeSet<C::Hash> {
        if !ENABLE_ENDORSEMENTS {
            return Default::default();
        };
        // First we collect all units that were already seen as endorsed by earlier units.
        let mut result: BTreeSet<C::Hash> = pan
            .iter_correct_hashes()
            .flat_map(|hash| self.unit(hash).endorsed.iter().cloned())
            .collect();
        // Now add all remaining endorsed units. Since the pan.sees check is expensive, do it only
        // for the ones that are actually new.
        for hash in self.endorsements.keys() {
            if !result.contains(hash) && pan.sees(self, hash) {
                result.insert(*hash);
            }
        }
        result
    }
pub ( crate ) fn seen_endorsed ( & self , pan : & Panorama < C > ) -> BTreeSet < C :: Hash > { if ! ENABLE_ENDORSEMENTS { return Default :: default ( ) ; } ; // First we collect all units that were already seen as endorsed by earlier units. let mut result : BTreeSet < C :: Hash > = pan . iter_correct_hashes ( ) . flat_map ( | hash | self . unit ( hash ) . endorsed . iter ( ) . cloned ( ) ) . collect ( ) ; // Now add all remaining endorsed units. Since the pan.sees check is expensive, do it only // for the ones that are actually new. for hash in self . endorsements . keys ( ) { if ! result . contains ( hash ) && pan . sees ( self , hash ) { result . insert ( * hash ) ; } } result }
Returns the set of units (by hash) that are endorsed and seen from the panorama.
Returns the set of units ( by hash ) that are endorsed and seen from the panorama .
&self
pan
&Panorama<C>
&self
pan
&Panorama<C>