+
+ // Note that we want to run a graph prune once not long after startup before
+ // falling back to our usual hourly prunes. This avoids short-lived clients never
+ // pruning their network graph. We run once 60 seconds after startup before
+ // continuing our normal cadence.
+ if last_prune_call.elapsed().as_secs() > if have_pruned { NETWORK_PRUNE_TIMER } else { 60 } {
+ if let Some(ref handler) = net_graph_msg_handler {
+ log_trace!(logger, "Pruning network graph of stale entries");
+ handler.network_graph().remove_stale_channels();
+ last_prune_call = Instant::now();
+ have_pruned = true;
+ }
+ }