@@ -318,7 +318,7 @@ where C::Target: chain::Access, L::Target: Logger
318
318
Ok ( msg. contents . excess_data . len ( ) <= MAX_EXCESS_BYTES_FOR_RELAY )
319
319
}
320
320
321
- fn get_next_channel_announcements ( & self , starting_point : u64 ) -> Option < ( ChannelAnnouncement , Option < ChannelUpdate > , Option < ChannelUpdate > ) > {
321
+ fn get_next_channel_announcement ( & self , starting_point : u64 ) -> Option < ( ChannelAnnouncement , Option < ChannelUpdate > , Option < ChannelUpdate > ) > {
322
322
let channels = self . network_graph . channels . read ( ) . unwrap ( ) ;
323
323
let mut iter = channels. range ( starting_point..) ;
324
324
loop {
@@ -344,7 +344,7 @@ where C::Target: chain::Access, L::Target: Logger
344
344
}
345
345
}
346
346
347
- fn get_next_node_announcements ( & self , starting_point : Option < & PublicKey > ) -> Option < NodeAnnouncement > {
347
+ fn get_next_node_announcement ( & self , starting_point : Option < & PublicKey > ) -> Option < NodeAnnouncement > {
348
348
let nodes = self . network_graph . nodes . read ( ) . unwrap ( ) ;
349
349
let mut iter = if let Some ( pubkey) = starting_point {
350
350
let mut iter = nodes. range ( NodeId :: from_pubkey ( pubkey) ..) ;
@@ -2408,7 +2408,7 @@ mod tests {
2408
2408
let node_2_privkey = & SecretKey :: from_slice ( & [ 41 ; 32 ] ) . unwrap ( ) ;
2409
2409
2410
2410
// Channels were not announced yet.
2411
- let channels_with_announcements = gossip_sync. get_next_channel_announcements ( 0 ) ;
2411
+ let channels_with_announcements = gossip_sync. get_next_channel_announcement ( 0 ) ;
2412
2412
assert ! ( channels_with_announcements. is_none( ) ) ;
2413
2413
2414
2414
let short_channel_id;
@@ -2423,7 +2423,7 @@ mod tests {
2423
2423
}
2424
2424
2425
2425
// Contains initial channel announcement now.
2426
- let channels_with_announcements = gossip_sync. get_next_channel_announcements ( short_channel_id) ;
2426
+ let channels_with_announcements = gossip_sync. get_next_channel_announcement ( short_channel_id) ;
2427
2427
if let Some ( channel_announcements) = channels_with_announcements {
2428
2428
let ( _, ref update_1, ref update_2) = channel_announcements;
2429
2429
assert_eq ! ( update_1, & None ) ;
@@ -2444,7 +2444,7 @@ mod tests {
2444
2444
}
2445
2445
2446
2446
// Now contains an initial announcement and an update.
2447
- let channels_with_announcements = gossip_sync. get_next_channel_announcements ( short_channel_id) ;
2447
+ let channels_with_announcements = gossip_sync. get_next_channel_announcement ( short_channel_id) ;
2448
2448
if let Some ( channel_announcements) = channels_with_announcements {
2449
2449
let ( _, ref update_1, ref update_2) = channel_announcements;
2450
2450
assert_ne ! ( update_1, & None ) ;
@@ -2466,7 +2466,7 @@ mod tests {
2466
2466
}
2467
2467
2468
2468
// Test that announcements with excess data won't be returned
2469
- let channels_with_announcements = gossip_sync. get_next_channel_announcements ( short_channel_id) ;
2469
+ let channels_with_announcements = gossip_sync. get_next_channel_announcement ( short_channel_id) ;
2470
2470
if let Some ( channel_announcements) = channels_with_announcements {
2471
2471
let ( _, ref update_1, ref update_2) = channel_announcements;
2472
2472
assert_eq ! ( update_1, & None ) ;
@@ -2476,7 +2476,7 @@ mod tests {
2476
2476
}
2477
2477
2478
2478
// Further starting point have no channels after it
2479
- let channels_with_announcements = gossip_sync. get_next_channel_announcements ( short_channel_id + 1000 ) ;
2479
+ let channels_with_announcements = gossip_sync. get_next_channel_announcement ( short_channel_id + 1000 ) ;
2480
2480
assert ! ( channels_with_announcements. is_none( ) ) ;
2481
2481
}
2482
2482
@@ -2489,7 +2489,7 @@ mod tests {
2489
2489
let node_id_1 = PublicKey :: from_secret_key ( & secp_ctx, node_1_privkey) ;
2490
2490
2491
2491
// No nodes yet.
2492
- let next_announcements = gossip_sync. get_next_node_announcements ( None ) ;
2492
+ let next_announcements = gossip_sync. get_next_node_announcement ( None ) ;
2493
2493
assert ! ( next_announcements. is_none( ) ) ;
2494
2494
2495
2495
{
@@ -2502,7 +2502,7 @@ mod tests {
2502
2502
}
2503
2503
2504
2504
// Nodes were never announced
2505
- let next_announcements = gossip_sync. get_next_node_announcements ( None ) ;
2505
+ let next_announcements = gossip_sync. get_next_node_announcement ( None ) ;
2506
2506
assert ! ( next_announcements. is_none( ) ) ;
2507
2507
2508
2508
{
@@ -2519,11 +2519,11 @@ mod tests {
2519
2519
} ;
2520
2520
}
2521
2521
2522
- let next_announcements = gossip_sync. get_next_node_announcements ( None ) ;
2522
+ let next_announcements = gossip_sync. get_next_node_announcement ( None ) ;
2523
2523
assert ! ( next_announcements. is_some( ) ) ;
2524
2524
2525
2525
// Skip the first node.
2526
- let next_announcements = gossip_sync. get_next_node_announcements ( Some ( & node_id_1) ) ;
2526
+ let next_announcements = gossip_sync. get_next_node_announcement ( Some ( & node_id_1) ) ;
2527
2527
assert ! ( next_announcements. is_some( ) ) ;
2528
2528
2529
2529
{
@@ -2538,7 +2538,7 @@ mod tests {
2538
2538
} ;
2539
2539
}
2540
2540
2541
- let next_announcements = gossip_sync. get_next_node_announcements ( Some ( & node_id_1) ) ;
2541
+ let next_announcements = gossip_sync. get_next_node_announcement ( Some ( & node_id_1) ) ;
2542
2542
assert ! ( next_announcements. is_none( ) ) ;
2543
2543
}
2544
2544
0 commit comments