@@ -476,7 +476,6 @@ mod test {
476
476
use lightning:: util:: enforcing_trait_impls:: EnforcingSigner ;
477
477
use lightning:: util:: events:: { MessageSendEvent , MessageSendEventsProvider , Event } ;
478
478
use lightning:: util:: test_utils;
479
- use lightning:: util:: config:: UserConfig ;
480
479
use lightning:: chain:: keysinterface:: KeysInterface ;
481
480
use utils:: create_invoice_from_channelmanager_and_duration_since_epoch;
482
481
use std:: collections:: HashSet ;
@@ -594,46 +593,6 @@ mod test {
594
593
match_invoice_routes ( Some ( 5000 ) , & nodes[ 0 ] , scid_aliases) ;
595
594
}
596
595
597
- #[ test]
598
- fn test_forwarding_info_not_assigned_channel_excluded_from_hints ( ) {
599
- let chanmon_cfgs = create_chanmon_cfgs ( 3 ) ;
600
- let node_cfgs = create_node_cfgs ( 3 , & chanmon_cfgs) ;
601
- let node_chanmgrs = create_node_chanmgrs ( 3 , & node_cfgs, & [ None , None , None ] ) ;
602
- let nodes = create_network ( 3 , & node_cfgs, & node_chanmgrs) ;
603
- let chan_1_0 = create_unannounced_chan_between_nodes_with_value ( & nodes, 1 , 0 , 100000 , 10001 , InitFeatures :: known ( ) , InitFeatures :: known ( ) ) ;
604
-
605
- // Create an unannonced channel between `nodes[2]` and `nodes[0]`, for which the
606
- // `msgs::ChannelUpdate` is never handled for the node(s). As the `msgs::ChannelUpdate`
607
- // is never handled, the `channel.counterparty.forwarding_info` is never assigned.
608
- let mut private_chan_cfg = UserConfig :: default ( ) ;
609
- private_chan_cfg. channel_options . announced_channel = false ;
610
- let temporary_channel_id = nodes[ 2 ] . node . create_channel ( nodes[ 0 ] . node . get_our_node_id ( ) , 1_000_000 , 500_000_000 , 42 , Some ( private_chan_cfg) ) . unwrap ( ) ;
611
- let open_channel = get_event_msg ! ( nodes[ 2 ] , MessageSendEvent :: SendOpenChannel , nodes[ 0 ] . node. get_our_node_id( ) ) ;
612
- nodes[ 0 ] . node . handle_open_channel ( & nodes[ 2 ] . node . get_our_node_id ( ) , InitFeatures :: known ( ) , & open_channel) ;
613
- let accept_channel = get_event_msg ! ( nodes[ 0 ] , MessageSendEvent :: SendAcceptChannel , nodes[ 2 ] . node. get_our_node_id( ) ) ;
614
- nodes[ 2 ] . node . handle_accept_channel ( & nodes[ 0 ] . node . get_our_node_id ( ) , InitFeatures :: known ( ) , & accept_channel) ;
615
-
616
- let tx = sign_funding_transaction ( & nodes[ 2 ] , & nodes[ 0 ] , 1_000_000 , temporary_channel_id) ;
617
-
618
- let conf_height = core:: cmp:: max ( nodes[ 2 ] . best_block_info ( ) . 1 + 1 , nodes[ 0 ] . best_block_info ( ) . 1 + 1 ) ;
619
- confirm_transaction_at ( & nodes[ 2 ] , & tx, conf_height) ;
620
- connect_blocks ( & nodes[ 2 ] , CHAN_CONFIRM_DEPTH - 1 ) ;
621
- confirm_transaction_at ( & nodes[ 0 ] , & tx, conf_height) ;
622
- connect_blocks ( & nodes[ 0 ] , CHAN_CONFIRM_DEPTH - 1 ) ;
623
- let as_funding_locked = get_event_msg ! ( nodes[ 2 ] , MessageSendEvent :: SendFundingLocked , nodes[ 0 ] . node. get_our_node_id( ) ) ;
624
- nodes[ 2 ] . node . handle_funding_locked ( & nodes[ 0 ] . node . get_our_node_id ( ) , & get_event_msg ! ( nodes[ 0 ] , MessageSendEvent :: SendFundingLocked , nodes[ 2 ] . node. get_our_node_id( ) ) ) ;
625
- get_event_msg ! ( nodes[ 2 ] , MessageSendEvent :: SendChannelUpdate , nodes[ 0 ] . node. get_our_node_id( ) ) ;
626
- nodes[ 0 ] . node . handle_funding_locked ( & nodes[ 2 ] . node . get_our_node_id ( ) , & as_funding_locked) ;
627
- get_event_msg ! ( nodes[ 0 ] , MessageSendEvent :: SendChannelUpdate , nodes[ 2 ] . node. get_our_node_id( ) ) ;
628
-
629
- // As `msgs::ChannelUpdate` was never handled for the participating node(s) of the second
630
- // channel, the channel will never be assigned any `counterparty.forwarding_info`.
631
- // Therefore only `chan_1_0` should be included in the hints.
632
- let mut scid_aliases = HashSet :: new ( ) ;
633
- scid_aliases. insert ( chan_1_0. 0 . short_channel_id_alias . unwrap ( ) ) ;
634
- match_invoice_routes ( Some ( 5000 ) , & nodes[ 0 ] , scid_aliases) ;
635
- }
636
-
637
596
#[ test]
638
597
fn test_no_hints_if_a_mix_between_public_and_private_channel_exists ( ) {
639
598
let chanmon_cfgs = create_chanmon_cfgs ( 3 ) ;
@@ -959,62 +918,6 @@ mod test {
959
918
) ;
960
919
}
961
920
962
- #[ test]
963
- #[ cfg( feature = "std" ) ]
964
- fn test_multi_node_forwarding_info_not_assigned_channel_excluded_from_hints ( ) {
965
- let mut chanmon_cfgs = create_chanmon_cfgs ( 4 ) ;
966
- let seed_1 = [ 42 as u8 ; 32 ] ;
967
- let seed_2 = [ 43 as u8 ; 32 ] ;
968
- let cross_node_seed = [ 44 as u8 ; 32 ] ;
969
- chanmon_cfgs[ 2 ] . keys_manager . backing = PhantomKeysManager :: new ( & seed_1, 43 , 44 , & cross_node_seed) ;
970
- chanmon_cfgs[ 3 ] . keys_manager . backing = PhantomKeysManager :: new ( & seed_2, 43 , 44 , & cross_node_seed) ;
971
- let node_cfgs = create_node_cfgs ( 4 , & chanmon_cfgs) ;
972
- let node_chanmgrs = create_node_chanmgrs ( 4 , & node_cfgs, & [ None , None , None , None ] ) ;
973
- let nodes = create_network ( 4 , & node_cfgs, & node_chanmgrs) ;
974
-
975
- let chan_0_2 = create_unannounced_chan_between_nodes_with_value ( & nodes, 0 , 2 , 100000 , 10001 , InitFeatures :: known ( ) , InitFeatures :: known ( ) ) ;
976
- let chan_0_3 = create_unannounced_chan_between_nodes_with_value ( & nodes, 0 , 3 , 1000000 , 10001 , InitFeatures :: known ( ) , InitFeatures :: known ( ) ) ;
977
-
978
- // Create an unannonced channel between `nodes[1]` and `nodes[3]`, for which the
979
- // `msgs::ChannelUpdate` is never handled for the node(s). As the `msgs::ChannelUpdate`
980
- // is never handled, the `channel.counterparty.forwarding_info` is never assigned.
981
- let mut private_chan_cfg = UserConfig :: default ( ) ;
982
- private_chan_cfg. channel_options . announced_channel = false ;
983
- let temporary_channel_id = nodes[ 1 ] . node . create_channel ( nodes[ 3 ] . node . get_our_node_id ( ) , 1_000_000 , 500_000_000 , 42 , Some ( private_chan_cfg) ) . unwrap ( ) ;
984
- let open_channel = get_event_msg ! ( nodes[ 1 ] , MessageSendEvent :: SendOpenChannel , nodes[ 3 ] . node. get_our_node_id( ) ) ;
985
- nodes[ 3 ] . node . handle_open_channel ( & nodes[ 1 ] . node . get_our_node_id ( ) , InitFeatures :: known ( ) , & open_channel) ;
986
- let accept_channel = get_event_msg ! ( nodes[ 3 ] , MessageSendEvent :: SendAcceptChannel , nodes[ 1 ] . node. get_our_node_id( ) ) ;
987
- nodes[ 1 ] . node . handle_accept_channel ( & nodes[ 3 ] . node . get_our_node_id ( ) , InitFeatures :: known ( ) , & accept_channel) ;
988
-
989
- let tx = sign_funding_transaction ( & nodes[ 1 ] , & nodes[ 3 ] , 1_000_000 , temporary_channel_id) ;
990
-
991
- let conf_height = core:: cmp:: max ( nodes[ 1 ] . best_block_info ( ) . 1 + 1 , nodes[ 3 ] . best_block_info ( ) . 1 + 1 ) ;
992
- confirm_transaction_at ( & nodes[ 1 ] , & tx, conf_height) ;
993
- connect_blocks ( & nodes[ 1 ] , CHAN_CONFIRM_DEPTH - 1 ) ;
994
- confirm_transaction_at ( & nodes[ 3 ] , & tx, conf_height) ;
995
- connect_blocks ( & nodes[ 3 ] , CHAN_CONFIRM_DEPTH - 1 ) ;
996
- let as_funding_locked = get_event_msg ! ( nodes[ 1 ] , MessageSendEvent :: SendFundingLocked , nodes[ 3 ] . node. get_our_node_id( ) ) ;
997
- nodes[ 1 ] . node . handle_funding_locked ( & nodes[ 3 ] . node . get_our_node_id ( ) , & get_event_msg ! ( nodes[ 3 ] , MessageSendEvent :: SendFundingLocked , nodes[ 1 ] . node. get_our_node_id( ) ) ) ;
998
- get_event_msg ! ( nodes[ 1 ] , MessageSendEvent :: SendChannelUpdate , nodes[ 3 ] . node. get_our_node_id( ) ) ;
999
- nodes[ 3 ] . node . handle_funding_locked ( & nodes[ 1 ] . node . get_our_node_id ( ) , & as_funding_locked) ;
1000
- get_event_msg ! ( nodes[ 3 ] , MessageSendEvent :: SendChannelUpdate , nodes[ 1 ] . node. get_our_node_id( ) ) ;
1001
-
1002
- // As `msgs::ChannelUpdate` was never handled for the participating node(s) of the third
1003
- // channel, the channel will never be assigned any `counterparty.forwarding_info`.
1004
- // Therefore only `chan_0_3` should be included in the hints for `nodes[3]`.
1005
- let mut scid_aliases = HashSet :: new ( ) ;
1006
- scid_aliases. insert ( chan_0_2. 0 . short_channel_id_alias . unwrap ( ) ) ;
1007
- scid_aliases. insert ( chan_0_3. 0 . short_channel_id_alias . unwrap ( ) ) ;
1008
-
1009
- match_multi_node_invoice_routes (
1010
- Some ( 10_000 ) ,
1011
- & nodes[ 2 ] ,
1012
- vec ! [ & nodes[ 2 ] , & nodes[ 3 ] , ] ,
1013
- scid_aliases,
1014
- false
1015
- ) ;
1016
- }
1017
-
1018
921
#[ test]
1019
922
#[ cfg( feature = "std" ) ]
1020
923
fn test_multi_node_with_only_public_channels_hints_includes_only_phantom_route ( ) {
0 commit comments