fn is_synced<T: BlockTree>(&mut self, now: LocalTime, tree: &T) -> bool {
        if let Some(last_update) = self.stale_tip(now, tree) {
            self.upstream.event(Event::StaleTipDetected(last_update));

            return false;
        }
        let height = tree.height();

        // Find the peer with the longest chain and compare our height to it.
        if let Some(peer_height) = self.peers.values().map(|p| p.height).max() {
            return height >= peer_height;
        }

        // Assume we're out of sync.
        false
    }
/// Check whether or not we are in sync with the network.
Check whether or not we are in sync with the network.
Check whether or not we are in sync with the network .
fn is_synced<T: BlockTree>(&mut self, now: LocalTime, tree: &T) -> bool {
        if let Some(last_update) = self.stale_tip(now, tree) {
            self.upstream.event(Event::StaleTipDetected(last_update));
            return false;
        }
        let height = tree.height();
        // Find the peer with the longest chain and compare our height to it.
        if let Some(peer_height) = self.peers.values().map(|p| p.height).max() {
            return height >= peer_height;
        }
        // Assume we're out of sync.
        false
    }
fn is_synced < T : BlockTree > ( & mut self , now : LocalTime , tree : & T ) -> bool { if let Some ( last_update ) = self . stale_tip ( now , tree ) { self . upstream . event ( Event :: StaleTipDetected ( last_update ) ) ; return false ; } let height = tree . height ( ) ; // Find the peer with the longest chain and compare our height to it. if let Some ( peer_height ) = self . peers . values ( ) . map ( | p | p . height ) . max ( ) { return height >= peer_height ; } // Assume we're out of sync. false }
Check whether or not we are in sync with the network.
Check whether or not we are in sync with the network .
&mut self
now
LocalTime
tree
&T