pub fn add(&mut self, pong: &Pong, socket: SocketAddr, now: Instant) -> bool {
        let node = (pong.pubkey(), socket);
        match self.pending_cache.peek(&pong.hash) {
            Some(value) if *value == node => {
                self.pings.pop(&node);
                self.pongs.put(node, now);
                self.pending_cache.pop(&pong.hash);
                true
            }
            _ => false,
        }
    }
/// Checks if the pong hash, pubkey and socket match a ping message sent
/// out previously. If so records current timestamp for the remote node and
/// returns true.
/// Note: Does not verify the signature.
Checks if the pong hash, pubkey and socket match a ping message sent
out previously. If so records current timestamp for the remote node and
returns true.
Note: Does not verify the signature.
Checks if the pong hash pubkey and socket match a ping message sent out previously . If so records current timestamp for the remote node and returns true . Note : Does not verify the signature .
pub fn add(&mut self, pong: &Pong, socket: SocketAddr, now: Instant) -> bool {
        let node = (pong.pubkey(), socket);
        match self.pending_cache.peek(&pong.hash) {
            Some(value) if *value == node => {
                self.pings.pop(&node);
                self.pongs.put(node, now);
                self.pending_cache.pop(&pong.hash);
                true
            }
            _ => false,
        }
    }
pub fn add ( & mut self , pong : & Pong , socket : SocketAddr , now : Instant ) -> bool { let node = ( pong . pubkey ( ) , socket ) ; match self . pending_cache . peek ( & pong . hash ) { Some ( value ) if * value == node => { self . pings . pop ( & node ) ; self . pongs . put ( node , now ) ; self . pending_cache . pop ( & pong . hash ) ; true } _ => false , } }
Checks if the pong hash, pubkey and socket match a ping message sent
out previously.
Checks if the pong hash pubkey and socket match a ping message sent out previously .
&mut self
pong
&Pong
socket
SocketAddr
now
Instant