Skip to content

Commit 1e8a6a3

Browse files
committed
f formatting
1 parent 617eadd commit 1e8a6a3

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

lightning/src/routing/gossip.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2530,8 +2530,10 @@ mod tests {
25302530
assert!(network_graph.read_only().channels().get(&short_channel_id).unwrap().one_to_two.is_none());
25312531

25322532
use std::time::{SystemTime, UNIX_EPOCH};
2533-
let announcement_time = SystemTime::now().duration_since(UNIX_EPOCH).expect("Time must be > 1970").as_secs();
2534-
network_graph.remove_stale_channels_and_tracking_with_time(announcement_time + 1 + STALE_CHANNEL_UPDATE_AGE_LIMIT_SECS);
2533+
let announcement_time = SystemTime::now().duration_since(UNIX_EPOCH)
2534+
.expect("Time must be > 1970").as_secs();
2535+
network_graph.remove_stale_channels_and_tracking_with_time(
2536+
announcement_time + 1 + STALE_CHANNEL_UPDATE_AGE_LIMIT_SECS);
25352537
}
25362538

25372539
assert_eq!(network_graph.read_only().channels().len(), 0);
@@ -2546,8 +2548,11 @@ mod tests {
25462548
network_graph.removed_channels.lock().unwrap().clear();
25472549

25482550
// Track some nodes and channels as removed
2549-
let started_tracking_time = SystemTime::now().duration_since(UNIX_EPOCH).expect("Time must be > 1970").as_secs();
2550-
network_graph.removed_nodes.lock().unwrap().insert(NodeId::from_pubkey(&PublicKey::from_secret_key(&secp_ctx, node_1_privkey)), started_tracking_time);
2551+
let started_tracking_time = SystemTime::now().duration_since(UNIX_EPOCH)
2552+
.expect("Time must be > 1970").as_secs();
2553+
network_graph.removed_nodes.lock().unwrap().insert(
2554+
NodeId::from_pubkey(&PublicKey::from_secret_key(&secp_ctx, node_1_privkey)),
2555+
started_tracking_time);
25512556
network_graph.removed_channels.lock().unwrap().insert(1, started_tracking_time);
25522557

25532558
// Should not remove from tracking if insufficient time has passed
@@ -2556,7 +2561,8 @@ mod tests {
25562561
assert_eq!(network_graph.removed_channels.lock().unwrap().len(), 1);
25572562

25582563
// Node and channel entry should be removed on next call
2559-
network_graph.remove_stale_channels_and_tracking_with_time(started_tracking_time + STALE_CHANNEL_UPDATE_AGE_LIMIT_SECS);
2564+
network_graph.remove_stale_channels_and_tracking_with_time(
2565+
started_tracking_time + STALE_CHANNEL_UPDATE_AGE_LIMIT_SECS);
25602566
assert!(network_graph.removed_nodes.lock().unwrap().is_empty());
25612567
assert!(network_graph.removed_channels.lock().unwrap().is_empty());
25622568
}

0 commit comments

Comments
 (0)