/// The Peer manager's heartbeat maintains the peer count and maintains peer reputations.
///
/// It will request discovery queries if the peer count has not reached the desired number of
/// peers.
///
/// NOTE: Discovery will only add a new query if one isn't already queued.
The Peer manager's heartbeat maintains the peer count and maintains peer reputations.
It will request discovery queries if the peer count has not reached the desired number of
peers.

Discovery will only add a new query if one isn't already queued.
The Peer manager ' s heartbeat maintains the peer count and maintains peer reputations . It will request discovery queries if the peer count has not reached the desired number of peers . Discovery will only add a new query if one isn ' t already queued .
fn heartbeat(&mut self) {
        // TODO: Provide a back-off time for discovery queries. I.e Queue many initially, then only
        // perform discoveries over a larger fixed interval. Perhaps one every 6 heartbeats
        let peer_count = self.network_globals.connected_or_dialing_peers();
        if peer_count < self.target_peers {
            // If we need more peers, queue a discovery lookup.
            self.discovery.discover_peers();
        }
        // TODO: If we have too many peers, remove peers that are not required for subnet
        // validation.
        // TODO: Perform peer reputation maintenance here
    }
fn heartbeat ( & mut self ) { // TODO: Provide a back-off time for discovery queries. I.e Queue many initially, then only // perform discoveries over a larger fixed interval. Perhaps one every 6 heartbeats let peer_count = self . network_globals . connected_or_dialing_peers ( ) ; if peer_count < self . target_peers { // If we need more peers, queue a discovery lookup. self . discovery . discover_peers ( ) ; } // TODO: If we have too many peers, remove peers that are not required for subnet // validation. // TODO: Perform peer reputation maintenance here }
The Peer manager's heartbeat maintains the peer count and maintains peer reputations.
The Peer manager ' s heartbeat maintains the peer count and maintains peer reputations .
&mut self