Skip to content

Commit

Permalink
Add error messages to stale gossip cleanup assertions.
Browse files Browse the repository at this point in the history
Should help debug lightningdevkit#1914.
  • Loading branch information
arik-so committed Jan 14, 2023
1 parent ac6e0b3 commit e9d4ae1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lightning/src/routing/gossip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2542,13 +2542,13 @@ mod tests {
// Should not remove from tracking if insufficient time has passed
network_graph.remove_stale_channels_and_tracking_with_time(
tracking_time + REMOVED_ENTRIES_TRACKING_AGE_LIMIT_SECS - 1);
assert_eq!(network_graph.removed_channels.lock().unwrap().len(), 1);
assert_eq!(network_graph.removed_channels.lock().unwrap().len(), 1, "Removed channel count ≠ 1 with tracking_time {}", tracking_time);

// Provide a later time so that sufficient time has passed
network_graph.remove_stale_channels_and_tracking_with_time(
tracking_time + REMOVED_ENTRIES_TRACKING_AGE_LIMIT_SECS);
assert!(network_graph.removed_channels.lock().unwrap().is_empty());
assert!(network_graph.removed_nodes.lock().unwrap().is_empty());
assert!(network_graph.removed_channels.lock().unwrap().is_empty(), "Unexpectedly removed channels with tracking_time {}", tracking_time);
assert!(network_graph.removed_nodes.lock().unwrap().is_empty(), "Unexpectedly removed nodes with tracking_time {}", tracking_time);
}

#[cfg(not(feature = "std"))]
Expand Down

0 comments on commit e9d4ae1

Please sign in to comment.