pub fn add_peer(&self, peer: PeerNetworkId) -> bool {
        let mut peer_info = self
            .peer_info
            .lock()
            .expect("failed to acquire peer_info lock");
        let is_new_peer = !peer_info.contains_key(&peer);
        if self.is_upstream_peer(peer) {
            peer_info
                .entry(peer)
                .or_insert(PeerSyncState {
                    timeline_id: 0,
                    is_alive: true,
                })
                .is_alive = true;
        }
        is_new_peer
    }
// returns true if `peer` is discovered for first time, else false
returns true if `peer` is discovered for first time, else false
returns true if ` peer ` is discovered for first time else false
pub fn add_peer(&self, peer: PeerNetworkId) -> bool {
        let mut peer_info = self
            .peer_info
            .lock()
            .expect("failed to acquire peer_info lock");
        let is_new_peer = !peer_info.contains_key(&peer);
        if self.is_upstream_peer(peer) {
            peer_info
                .entry(peer)
                .or_insert(PeerSyncState {
                    timeline_id: 0,
                    is_alive: true,
                })
                .is_alive = true;
        }
        is_new_peer
    }
pub fn add_peer ( & self , peer : PeerNetworkId ) -> bool { let mut peer_info = self . peer_info . lock ( ) . expect ( " " ) ; let is_new_peer = ! peer_info . contains_key ( & peer ) ; if self . is_upstream_peer ( peer ) { peer_info . entry ( peer ) . or_insert ( PeerSyncState { timeline_id : 0 , is_alive : true , } ) . is_alive = true ; } is_new_peer }
returns true if `peer` is discovered for first time, else false
returns true if ` peer ` is discovered for first time else false
&self
peer
PeerNetworkId
&self
peer
PeerNetworkId