@@ -2530,8 +2530,10 @@ mod tests {
2530
2530
assert ! ( network_graph. read_only( ) . channels( ) . get( & short_channel_id) . unwrap( ) . one_to_two. is_none( ) ) ;
2531
2531
2532
2532
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 ) ;
2535
2537
}
2536
2538
2537
2539
assert_eq ! ( network_graph. read_only( ) . channels( ) . len( ) , 0 ) ;
@@ -2546,8 +2548,11 @@ mod tests {
2546
2548
network_graph. removed_channels . lock ( ) . unwrap ( ) . clear ( ) ;
2547
2549
2548
2550
// 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) ;
2551
2556
network_graph. removed_channels . lock ( ) . unwrap ( ) . insert ( 1 , started_tracking_time) ;
2552
2557
2553
2558
// Should not remove from tracking if insufficient time has passed
@@ -2556,7 +2561,8 @@ mod tests {
2556
2561
assert_eq ! ( network_graph. removed_channels. lock( ) . unwrap( ) . len( ) , 1 ) ;
2557
2562
2558
2563
// 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 ) ;
2560
2566
assert ! ( network_graph. removed_nodes. lock( ) . unwrap( ) . is_empty( ) ) ;
2561
2567
assert ! ( network_graph. removed_channels. lock( ) . unwrap( ) . is_empty( ) ) ;
2562
2568
}
0 commit comments