pub fn sanitized(&self, now: chrono::DateTime<Utc>) -> Vec<MetaAddr> {
        use rand::seq::SliceRandom;
        let _guard = self.span.enter();

        let mut peers = self.by_addr.clone();

        // Unconditionally add our local listener address to the advertised peers,
        // to replace any self-connection failures. The address book and change
        // constructors make sure that the SocketAddr is canonical.
        let local_listener = self.local_listener_meta_addr();
        peers.insert(local_listener.addr, local_listener);

        // Then sanitize and shuffle
        let mut peers = peers
            .descending_values()
            .filter_map(MetaAddr::sanitize)
            // Security: remove peers that:
            //   - last responded more than three hours ago, or
            //   - haven't responded yet but were reported last seen more than three hours ago
            //
            // This prevents Zebra from gossiping nodes that are likely unreachable. Gossiping such
            // nodes impacts the network health, because connection attempts end up being wasted on
            // peers that are less likely to respond.
            .filter(|addr| addr.is_active_for_gossip(now))
            .collect::<Vec<_>>();
        peers.shuffle(&mut rand::thread_rng());
        peers
    }
/// Get the contents of `self` in random order with sanitized timestamps.
Get the contents of `self` in random order with sanitized timestamps.
Get the contents of ` self ` in random order with sanitized timestamps .
pub fn sanitized(&self, now: chrono::DateTime<Utc>) -> Vec<MetaAddr> {
        use rand::seq::SliceRandom;
        let _guard = self.span.enter();
        let mut peers = self.by_addr.clone();
        // Unconditionally add our local listener address to the advertised peers,
        // to replace any self-connection failures. The address book and change
        // constructors make sure that the SocketAddr is canonical.
        let local_listener = self.local_listener_meta_addr();
        peers.insert(local_listener.addr, local_listener);
        // Then sanitize and shuffle
        let mut peers = peers
            .descending_values()
            .filter_map(MetaAddr::sanitize)
            // Security: remove peers that:
            //   - last responded more than three hours ago, or
            //   - haven't responded yet but were reported last seen more than three hours ago
            //
            // This prevents Zebra from gossiping nodes that are likely unreachable. Gossiping such
            // nodes impacts the network health, because connection attempts end up being wasted on
            // peers that are less likely to respond.
            .filter(|addr| addr.is_active_for_gossip(now))
            .collect::<Vec<_>>();
        peers.shuffle(&mut rand::thread_rng());
        peers
    }
pub fn sanitized ( & self , now : chrono :: DateTime < Utc > ) -> Vec < MetaAddr > { use rand :: seq :: SliceRandom ; let _guard = self . span . enter ( ) ; let mut peers = self . by_addr . clone ( ) ; // Unconditionally add our local listener address to the advertised peers, // to replace any self-connection failures. The address book and change // constructors make sure that the SocketAddr is canonical. let local_listener = self . local_listener_meta_addr ( ) ; peers . insert ( local_listener . addr , local_listener ) ; // Then sanitize and shuffle let mut peers = peers . descending_values ( ) . filter_map ( MetaAddr :: sanitize ) // Security: remove peers that: //   - last responded more than three hours ago, or //   - haven't responded yet but were reported last seen more than three hours ago // // This prevents Zebra from gossiping nodes that are likely unreachable. Gossiping such // nodes impacts the network health, because connection attempts end up being wasted on // peers that are less likely to respond. . filter ( | addr | addr . is_active_for_gossip ( now ) ) . collect :: < Vec < _ > > ( ) ; peers . shuffle ( & mut rand :: thread_rng ( ) ) ; peers }
Get the contents of `self` in random order with sanitized timestamps.
Get the contents of ` self ` in random order with sanitized timestamps .
&self
now
chrono::DateTime<Utc>