@@ -283,8 +283,8 @@ macro_rules! define_run_body {
283283 // continuing our normal cadence.
284284 if last_prune_call. elapsed( ) . as_secs( ) > if have_pruned { NETWORK_PRUNE_TIMER } else { FIRST_NETWORK_PRUNE_TIMER } {
285285 // The network graph must not be pruned while rapid sync completion is pending
286- log_trace!( $logger, "Assessing prunability of network graph" ) ;
287286 if let Some ( network_graph) = $gossip_sync. prunable_network_graph( ) {
287+ log_trace!( $logger, "Pruning and persisting network graph." ) ;
288288 network_graph. remove_stale_channels_and_tracking( ) ;
289289
290290 if let Err ( e) = $persister. persist_graph( network_graph) {
@@ -293,8 +293,6 @@ macro_rules! define_run_body {
293293
294294 last_prune_call = Instant :: now( ) ;
295295 have_pruned = true ;
296- } else {
297- log_trace!( $logger, "Not pruning network graph, either due to pending rapid gossip sync or absence of a prunable graph." ) ;
298296 }
299297 }
300298
@@ -1072,10 +1070,11 @@ mod tests {
10721070
10731071 loop {
10741072 let log_entries = nodes[ 0 ] . logger . lines . lock ( ) . unwrap ( ) ;
1075- let expected_log_a = "Assessing prunability of network graph" . to_string ( ) ;
1076- let expected_log_b = "Not pruning network graph, either due to pending rapid gossip sync or absence of a prunable graph." . to_string ( ) ;
1077- if log_entries. get ( & ( "lightning_background_processor" . to_string ( ) , expected_log_a) ) . is_some ( ) &&
1078- log_entries. get ( & ( "lightning_background_processor" . to_string ( ) , expected_log_b) ) . is_some ( ) {
1073+ let loop_counter = "Calling ChannelManager's timer_tick_occurred" . to_string ( ) ;
1074+ if * log_entries. get ( & ( "lightning_background_processor" . to_string ( ) , loop_counter) )
1075+ . unwrap_or ( & 0 ) > 1
1076+ {
1077+ // Wait until the loop has gone around at least twice.
10791078 break
10801079 }
10811080 }
0 commit comments