pub fn meta_data_response(&mut self, peer_id: &PeerId, meta_data: MetaData) {
        if let Some(peer_info) = self.network_globals.peers.write().peer_info_mut(peer_id) {
            if let Some(known_meta_data) = &peer_info.meta_data {
                if known_meta_data.seq_number < meta_data.seq_number {
                    debug!(self.log, "Updating peer's metadata";
                        "peer_id" => peer_id.to_string(), "known_seq_no" => known_meta_data.seq_number, "new_seq_no" => meta_data.seq_number);
                    peer_info.meta_data = Some(meta_data);
                } else {
                    debug!(self.log, "Received old metadata";
                        "peer_id" => peer_id.to_string(), "known_seq_no" => known_meta_data.seq_number, "new_seq_no" => meta_data.seq_number);
                }
            } else {
                // we have no meta-data for this peer, update
                debug!(self.log, "Obtained peer's metadata";
                    "peer_id" => peer_id.to_string(), "new_seq_no" => meta_data.seq_number);
                peer_info.meta_data = Some(meta_data);
            }
        } else {
            crit!(self.log, "Received METADATA from an unknown peer";
                "peer_id" => peer_id.to_string());
        }
    }
/// Received a metadata response from a peer.
// TODO: Update last seen
Received a metadata response from a peer.
TODO: Update last seen
Received a metadata response from a peer . TODO : Update last seen
pub fn meta_data_response(&mut self, peer_id: &PeerId, meta_data: MetaData) {
        if let Some(peer_info) = self.network_globals.peers.write().peer_info_mut(peer_id) {
            if let Some(known_meta_data) = &peer_info.meta_data {
                if known_meta_data.seq_number < meta_data.seq_number {
                    debug!(self.log, "Updating peer's metadata";
                        "peer_id" => peer_id.to_string(), "known_seq_no" => known_meta_data.seq_number, "new_seq_no" => meta_data.seq_number);
                    peer_info.meta_data = Some(meta_data);
                } else {
                    debug!(self.log, "Received old metadata";
                        "peer_id" => peer_id.to_string(), "known_seq_no" => known_meta_data.seq_number, "new_seq_no" => meta_data.seq_number);
                }
            } else {
                // we have no meta-data for this peer, update
                debug!(self.log, "Obtained peer's metadata";
                    "peer_id" => peer_id.to_string(), "new_seq_no" => meta_data.seq_number);
                peer_info.meta_data = Some(meta_data);
            }
        } else {
            crit!(self.log, "Received METADATA from an unknown peer";
                "peer_id" => peer_id.to_string());
        }
    }
pub fn meta_data_response ( & mut self , peer_id : & PeerId , meta_data : MetaData ) { if let Some ( peer_info ) = self . network_globals . peers . write ( ) . peer_info_mut ( peer_id ) { if let Some ( known_meta_data ) = & peer_info . meta_data { if known_meta_data . seq_number < meta_data . seq_number { debug ! ( self log " " " " peer_id to_string ( ) " " known_meta_data seq_number " " meta_data seq_number ) ; peer_info . meta_data = Some ( meta_data ) ; } else { debug ! ( self log " " " " peer_id to_string ( ) " " known_meta_data seq_number " " meta_data seq_number ) ; } } else { // we have no meta-data for this peer, update debug ! ( self log " " " " peer_id to_string ( ) " " meta_data seq_number ) ; peer_info . meta_data = Some ( meta_data ) ; } } else { crit ! ( self log " " " " peer_id to_string ( ) ) ; } }
Received a metadata response from a peer.
Received a metadata response from a peer .
&mut self
peer_id
&PeerId
meta_data
MetaData
&mut self
peer_id
&PeerId
meta_data
MetaData