pub fn sanitize(&self) -> Option<MetaAddr> {
        if !self.last_known_info_is_valid_for_outbound() {
            return None;
        }

        // Sanitize time
        let last_seen = self.last_seen()?;
        let remainder = last_seen
            .timestamp()
            .rem_euclid(crate::constants::TIMESTAMP_TRUNCATION_SECONDS);
        let last_seen = last_seen
            .checked_sub(remainder.into())
            .expect("unexpected underflow: rem_euclid is strictly less than timestamp");

        Some(MetaAddr {
            addr: canonical_socket_addr(self.addr),
            // initial peers are sanitized assuming they are `NODE_NETWORK`
            // TODO: split untrusted and direct services
            //       consider sanitizing untrusted services to NODE_NETWORK (#2324)
            services: self.services.or(Some(PeerServices::NODE_NETWORK)),
            // only put the last seen time in the untrusted field,
            // this matches deserialization, and avoids leaking internal state
            untrusted_last_seen: Some(last_seen),
            last_response: None,
            // these fields aren't sent to the remote peer, but sanitize them anyway
            last_attempt: None,
            last_failure: None,
            last_connection_state: NeverAttemptedGossiped,
        })
    }
/// Return a sanitized version of this `MetaAddr`, for sending to a remote peer.
///
/// Returns `None` if this `MetaAddr` should not be sent to remote peers.
Return a sanitized version of this `MetaAddr`, for sending to a remote peer.
Returns `None` if this `MetaAddr` should not be sent to remote peers.
Return a sanitized version of this ` MetaAddr ` for sending to a remote peer . Returns ` None ` if this ` MetaAddr ` should not be sent to remote peers .
pub fn sanitize(&self) -> Option<MetaAddr> {
        if !self.last_known_info_is_valid_for_outbound() {
            return None;
        }
        // Sanitize time
        let last_seen = self.last_seen()?;
        let remainder = last_seen
            .timestamp()
            .rem_euclid(crate::constants::TIMESTAMP_TRUNCATION_SECONDS);
        let last_seen = last_seen
            .checked_sub(remainder.into())
            .expect("unexpected underflow: rem_euclid is strictly less than timestamp");
        Some(MetaAddr {
            addr: canonical_socket_addr(self.addr),
            // initial peers are sanitized assuming they are `NODE_NETWORK`
            // TODO: split untrusted and direct services
            //       consider sanitizing untrusted services to NODE_NETWORK (#2324)
            services: self.services.or(Some(PeerServices::NODE_NETWORK)),
            // only put the last seen time in the untrusted field,
            // this matches deserialization, and avoids leaking internal state
            untrusted_last_seen: Some(last_seen),
            last_response: None,
            // these fields aren't sent to the remote peer, but sanitize them anyway
            last_attempt: None,
            last_failure: None,
            last_connection_state: NeverAttemptedGossiped,
        })
    }
pub fn sanitize ( & self ) -> Option < MetaAddr > { if ! self . last_known_info_is_valid_for_outbound ( ) { return None ; } // Sanitize time let last_seen = self . last_seen ( ) ? ; let remainder = last_seen . timestamp ( ) . rem_euclid ( crate :: constants :: TIMESTAMP_TRUNCATION_SECONDS ) ; let last_seen = last_seen . checked_sub ( remainder . into ( ) ) . expect ( " " ) ; Some ( MetaAddr { addr : canonical_socket_addr ( self . addr ) , // initial peers are sanitized assuming they are `NODE_NETWORK` // TODO: split untrusted and direct services //       consider sanitizing untrusted services to NODE_NETWORK (#2324) services : self . services . or ( Some ( PeerServices :: NODE_NETWORK ) ) , // only put the last seen time in the untrusted field, // this matches deserialization, and avoids leaking internal state untrusted_last_seen : Some ( last_seen ) , last_response : None , // these fields aren't sent to the remote peer, but sanitize them anyway last_attempt : None , last_failure : None , last_connection_state : NeverAttemptedGossiped , } ) }
Return a sanitized version of this `MetaAddr`, for sending to a remote peer.
Return a sanitized version of this ` MetaAddr ` for sending to a remote peer .
&self