async fn add_multiaddr(&self, peer_id: &PeerId, addr: Multiaddr) {
        let mut book = self.book.lock().await;

        if let Some(mut peer_info) = book.take(peer_id) {
            peer_info.multiaddrs.insert(addr);
            book.insert(peer_info);
        } else {
            book.insert(PeerInfo::with_addr(peer_id.to_owned(), addr));
        }
    }
// TODO: check peer id in multiaddr match given peer id.
// But we need to take care of relay address.
check peer id in multiaddr match given peer id.
But we need to take care of relay address.
check peer id in multiaddr match given peer id . But we need to take care of relay address .
async fn add_multiaddr(&self, peer_id: &PeerId, addr: Multiaddr) {
        let mut book = self.book.lock().await;
        if let Some(mut peer_info) = book.take(peer_id) {
            peer_info.multiaddrs.insert(addr);
            book.insert(peer_info);
        } else {
            book.insert(PeerInfo::with_addr(peer_id.to_owned(), addr));
        }
    }
async fn add_multiaddr ( & self , peer_id : & PeerId , addr : Multiaddr ) { let mut book = self . book . lock ( ) . await ; if let Some ( mut peer_info ) = book . take ( peer_id ) { peer_info . multiaddrs . insert ( addr ) ; book . insert ( peer_info ) ; } else { book . insert ( PeerInfo :: with_addr ( peer_id . to_owned ( ) , addr ) ) ; } }
TODO: check peer id in multiaddr match given peer id.
TODO : check peer id in multiaddr match given peer id .
&self
peer_id
&PeerId
addr
Multiaddr