File tree 1 file changed +8
-2
lines changed
lightning-background-processor/src
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -351,9 +351,15 @@ macro_rules! define_run_body {
351
351
// Note that we want to run a graph prune once not long after startup before
352
352
// falling back to our usual hourly prunes. This avoids short-lived clients never
353
353
// pruning their network graph. We run once 60 seconds after startup before
354
- // continuing our normal cadence.
354
+ // continuing our normal cadence. For RGS, since 60 seconds is likely too long,
355
+ // we prune after an initial sync completes.
355
356
let prune_timer = if have_pruned { NETWORK_PRUNE_TIMER } else { FIRST_NETWORK_PRUNE_TIMER } ;
356
- if $timer_elapsed( & mut last_prune_call, prune_timer) {
357
+ let prune_timer_elapsed = $timer_elapsed( & mut last_prune_call, prune_timer) ;
358
+ let should_prune = match $gossip_sync {
359
+ GossipSync :: Rapid ( _) => !have_pruned || prune_timer_elapsed,
360
+ _ => prune_timer_elapsed,
361
+ } ;
362
+ if should_prune {
357
363
// The network graph must not be pruned while rapid sync completion is pending
358
364
if let Some ( network_graph) = $gossip_sync. prunable_network_graph( ) {
359
365
#[ cfg( feature = "std" ) ] {
You can’t perform that action at this time.
0 commit comments