@@ -283,8 +283,8 @@ macro_rules! define_run_body {
283
283
// continuing our normal cadence.
284
284
if last_prune_call. elapsed( ) . as_secs( ) > if have_pruned { NETWORK_PRUNE_TIMER } else { FIRST_NETWORK_PRUNE_TIMER } {
285
285
// The network graph must not be pruned while rapid sync completion is pending
286
- log_trace!( $logger, "Assessing prunability of network graph" ) ;
287
286
if let Some ( network_graph) = $gossip_sync. prunable_network_graph( ) {
287
+ log_trace!( $logger, "Pruning and persisting network graph." ) ;
288
288
network_graph. remove_stale_channels_and_tracking( ) ;
289
289
290
290
if let Err ( e) = $persister. persist_graph( network_graph) {
@@ -293,8 +293,6 @@ macro_rules! define_run_body {
293
293
294
294
last_prune_call = Instant :: now( ) ;
295
295
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." ) ;
298
296
}
299
297
}
300
298
@@ -1072,10 +1070,11 @@ mod tests {
1072
1070
1073
1071
loop {
1074
1072
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.
1079
1078
break
1080
1079
}
1081
1080
}
0 commit comments