File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed 
lightning-background-processor/src Expand file tree Collapse file tree 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 {
351351			// Note that we want to run a graph prune once not long after startup before 
352352			// falling back to our usual hourly prunes. This avoids short-lived clients never 
353353			// 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. 
355356			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 { 
357363				// The network graph must not be pruned while rapid sync completion is pending 
358364				if  let  Some ( network_graph)  = $gossip_sync. prunable_network_graph( )  { 
359365					#[ cfg( feature = "std" ) ]  { 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments