fn stale_tip<T: BlockTree>(&self, now: LocalTime, tree: &T) -> Option<LocalTime> {
        if let Some(last_update) = self.last_tip_update {
            if last_update
                < now - LocalDuration::from_secs(self.config.params.pow_target_spacing * 3)
            {
                return Some(last_update);
            }
        }
        // If we don't have the time of the last update, it's probably because we
        // are fresh, or restarted our node. In that case we check the last block time
        // instead.
        let (_, tip) = tree.tip();
        let time = LocalTime::from_block_time(tip.time);

        if time <= now - TIP_STALE_DURATION {
            return Some(time);
        }

        None
    }
/// Check whether our current tip is stale.
///
/// *Nb. This doesn't check whether we've already requested new blocks.*
Check whether our current tip is stale.
Nb. This doesn't check whether we've already requested new blocks.
Check whether our current tip is stale . Nb . This doesn ' t check whether we ' ve already requested new blocks .
fn stale_tip<T: BlockTree>(&self, now: LocalTime, tree: &T) -> Option<LocalTime> {
        if let Some(last_update) = self.last_tip_update {
            if last_update
                < now - LocalDuration::from_secs(self.config.params.pow_target_spacing * 3)
            {
                return Some(last_update);
            }
        }
        // If we don't have the time of the last update, it's probably because we
        // are fresh, or restarted our node. In that case we check the last block time
        // instead.
        let (_, tip) = tree.tip();
        let time = LocalTime::from_block_time(tip.time);
        if time <= now - TIP_STALE_DURATION {
            return Some(time);
        }
        None
    }
fn stale_tip < T : BlockTree > ( & self , now : LocalTime , tree : & T ) -> Option < LocalTime > { if let Some ( last_update ) = self . last_tip_update { if last_update < now - LocalDuration :: from_secs ( self . config . params . pow_target_spacing * 3 ) { return Some ( last_update ) ; } } // If we don't have the time of the last update, it's probably because we // are fresh, or restarted our node. In that case we check the last block time // instead. let ( _ , tip ) = tree . tip ( ) ; let time = LocalTime :: from_block_time ( tip . time ) ; if time <= now - TIP_STALE_DURATION { return Some ( time ) ; } None }
Check whether our current tip is stale.
Check whether our current tip is stale .
&self
now
LocalTime
tree
&T