Skip to content

Commit affab46

Browse files
committed
f prune once on startup
1 parent 2248427 commit affab46

File tree

1 file changed

+5
-1
lines changed
  • lightning-background-processor/src

1 file changed

+5
-1
lines changed

lightning-background-processor/src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,11 @@ impl BackgroundProcessor {
215215

216216
let mut last_freshness_call = Instant::now();
217217
let mut last_ping_call = Instant::now();
218-
let mut last_prune_call = Instant::now();
218+
// Note that we want to run a graph prune once not long after startup before falling
219+
// back to our usual hourly prunes. This avoids short-lived clients never pruning their
220+
// network graph. We default here to once a minute after startup.
221+
let mut last_prune_call = Instant::now() + Duration::from_secs(60) - Duration::from_secs(NETWORK_PRUNE_TIMER);
222+
219223
loop {
220224
peer_manager.process_events();
221225
channel_manager.process_pending_events(&event_handler);

0 commit comments

Comments
 (0)