@@ -38,7 +38,7 @@ use lightning::chain::transaction::OutPoint;
3838use lightning:: chain:: chaininterface:: { BroadcasterInterface , ConfirmationTarget , FeeEstimator } ;
3939use lightning:: chain:: keysinterface:: { KeyMaterial , InMemorySigner , Recipient , EntropySource , NodeSigner , SignerProvider } ;
4040use lightning:: ln:: { PaymentHash , PaymentPreimage , PaymentSecret } ;
41- use lightning:: ln:: channelmanager:: { self , ChainParameters , ChannelDetails , ChannelManager , PaymentSendFailure , ChannelManagerReadArgs , PaymentId } ;
41+ use lightning:: ln:: channelmanager:: { ChainParameters , ChannelDetails , ChannelManager , PaymentSendFailure , ChannelManagerReadArgs , PaymentId } ;
4242use lightning:: ln:: channel:: FEE_SPIKE_BUFFER_FEE_INCREASE_MULTIPLE ;
4343use lightning:: ln:: msgs:: { self , CommitmentUpdate , ChannelMessageHandler , DecodeError , UpdateAddHTLC , Init } ;
4444use lightning:: ln:: script:: ShutdownScript ;
@@ -351,9 +351,9 @@ fn send_payment(source: &ChanMan, dest: &ChanMan, dest_chan_id: u64, amt: u64, p
351351 if let Err ( err) = source. send_payment ( & Route {
352352 paths : vec ! [ vec![ RouteHop {
353353 pubkey: dest. get_our_node_id( ) ,
354- node_features: channelmanager :: provided_node_features ( ) ,
354+ node_features: dest . node_features ( ) ,
355355 short_channel_id: dest_chan_id,
356- channel_features: channelmanager :: provided_channel_features ( ) ,
356+ channel_features: dest . channel_features ( ) ,
357357 fee_msat: amt,
358358 cltv_expiry_delta: 200 ,
359359 } ] ] ,
@@ -373,16 +373,16 @@ fn send_hop_payment(source: &ChanMan, middle: &ChanMan, middle_chan_id: u64, des
373373 if let Err ( err) = source. send_payment ( & Route {
374374 paths : vec ! [ vec![ RouteHop {
375375 pubkey: middle. get_our_node_id( ) ,
376- node_features: channelmanager :: provided_node_features ( ) ,
376+ node_features: middle . node_features ( ) ,
377377 short_channel_id: middle_chan_id,
378- channel_features: channelmanager :: provided_channel_features ( ) ,
378+ channel_features: middle . channel_features ( ) ,
379379 fee_msat: 50000 ,
380380 cltv_expiry_delta: 100 ,
381381 } , RouteHop {
382382 pubkey: dest. get_our_node_id( ) ,
383- node_features: channelmanager :: provided_node_features ( ) ,
383+ node_features: dest . node_features ( ) ,
384384 short_channel_id: dest_chan_id,
385- channel_features: channelmanager :: provided_channel_features ( ) ,
385+ channel_features: dest . channel_features ( ) ,
386386 fee_msat: amt,
387387 cltv_expiry_delta: 200 ,
388388 } ] ] ,
@@ -470,8 +470,8 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out) {
470470 let mut channel_txn = Vec :: new ( ) ;
471471 macro_rules! make_channel {
472472 ( $source: expr, $dest: expr, $chan_id: expr) => { {
473- $source. peer_connected( & $dest. get_our_node_id( ) , & Init { features: channelmanager :: provided_init_features ( ) , remote_network_address: None } ) . unwrap( ) ;
474- $dest. peer_connected( & $source. get_our_node_id( ) , & Init { features: channelmanager :: provided_init_features ( ) , remote_network_address: None } ) . unwrap( ) ;
473+ $source. peer_connected( & $dest. get_our_node_id( ) , & Init { features: $dest . init_features ( ) , remote_network_address: None } ) . unwrap( ) ;
474+ $dest. peer_connected( & $source. get_our_node_id( ) , & Init { features: $source . init_features ( ) , remote_network_address: None } ) . unwrap( ) ;
475475
476476 $source. create_channel( $dest. get_our_node_id( ) , 100_000 , 42 , 0 , None ) . unwrap( ) ;
477477 let open_channel = {
@@ -482,7 +482,7 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out) {
482482 } else { panic!( "Wrong event type" ) ; }
483483 } ;
484484
485- $dest. handle_open_channel( & $source. get_our_node_id( ) , channelmanager :: provided_init_features ( ) , & open_channel) ;
485+ $dest. handle_open_channel( & $source. get_our_node_id( ) , $source . init_features ( ) , & open_channel) ;
486486 let accept_channel = {
487487 let events = $dest. get_and_clear_pending_msg_events( ) ;
488488 assert_eq!( events. len( ) , 1 ) ;
@@ -491,7 +491,7 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out) {
491491 } else { panic!( "Wrong event type" ) ; }
492492 } ;
493493
494- $source. handle_accept_channel( & $dest. get_our_node_id( ) , channelmanager :: provided_init_features ( ) , & accept_channel) ;
494+ $source. handle_accept_channel( & $dest. get_our_node_id( ) , $dest . init_features ( ) , & accept_channel) ;
495495 let funding_output;
496496 {
497497 let events = $source. get_and_clear_pending_events( ) ;
@@ -990,15 +990,15 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out) {
990990 } ,
991991 0x0e => {
992992 if chan_a_disconnected {
993- nodes[ 0 ] . peer_connected ( & nodes[ 1 ] . get_our_node_id ( ) , & Init { features : channelmanager :: provided_init_features ( ) , remote_network_address : None } ) . unwrap ( ) ;
994- nodes[ 1 ] . peer_connected ( & nodes[ 0 ] . get_our_node_id ( ) , & Init { features : channelmanager :: provided_init_features ( ) , remote_network_address : None } ) . unwrap ( ) ;
993+ nodes[ 0 ] . peer_connected ( & nodes[ 1 ] . get_our_node_id ( ) , & Init { features : nodes [ 1 ] . init_features ( ) , remote_network_address : None } ) . unwrap ( ) ;
994+ nodes[ 1 ] . peer_connected ( & nodes[ 0 ] . get_our_node_id ( ) , & Init { features : nodes [ 0 ] . init_features ( ) , remote_network_address : None } ) . unwrap ( ) ;
995995 chan_a_disconnected = false ;
996996 }
997997 } ,
998998 0x0f => {
999999 if chan_b_disconnected {
1000- nodes[ 1 ] . peer_connected ( & nodes[ 2 ] . get_our_node_id ( ) , & Init { features : channelmanager :: provided_init_features ( ) , remote_network_address : None } ) . unwrap ( ) ;
1001- nodes[ 2 ] . peer_connected ( & nodes[ 1 ] . get_our_node_id ( ) , & Init { features : channelmanager :: provided_init_features ( ) , remote_network_address : None } ) . unwrap ( ) ;
1000+ nodes[ 1 ] . peer_connected ( & nodes[ 2 ] . get_our_node_id ( ) , & Init { features : nodes [ 2 ] . init_features ( ) , remote_network_address : None } ) . unwrap ( ) ;
1001+ nodes[ 2 ] . peer_connected ( & nodes[ 1 ] . get_our_node_id ( ) , & Init { features : nodes [ 1 ] . init_features ( ) , remote_network_address : None } ) . unwrap ( ) ;
10021002 chan_b_disconnected = false ;
10031003 }
10041004 } ,
@@ -1193,13 +1193,13 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out) {
11931193
11941194 // Next, make sure peers are all connected to each other
11951195 if chan_a_disconnected {
1196- nodes[ 0 ] . peer_connected ( & nodes[ 1 ] . get_our_node_id ( ) , & Init { features : channelmanager :: provided_init_features ( ) , remote_network_address : None } ) . unwrap ( ) ;
1197- nodes[ 1 ] . peer_connected ( & nodes[ 0 ] . get_our_node_id ( ) , & Init { features : channelmanager :: provided_init_features ( ) , remote_network_address : None } ) . unwrap ( ) ;
1196+ nodes[ 0 ] . peer_connected ( & nodes[ 1 ] . get_our_node_id ( ) , & Init { features : nodes [ 1 ] . init_features ( ) , remote_network_address : None } ) . unwrap ( ) ;
1197+ nodes[ 1 ] . peer_connected ( & nodes[ 0 ] . get_our_node_id ( ) , & Init { features : nodes [ 0 ] . init_features ( ) , remote_network_address : None } ) . unwrap ( ) ;
11981198 chan_a_disconnected = false ;
11991199 }
12001200 if chan_b_disconnected {
1201- nodes[ 1 ] . peer_connected ( & nodes[ 2 ] . get_our_node_id ( ) , & Init { features : channelmanager :: provided_init_features ( ) , remote_network_address : None } ) . unwrap ( ) ;
1202- nodes[ 2 ] . peer_connected ( & nodes[ 1 ] . get_our_node_id ( ) , & Init { features : channelmanager :: provided_init_features ( ) , remote_network_address : None } ) . unwrap ( ) ;
1201+ nodes[ 1 ] . peer_connected ( & nodes[ 2 ] . get_our_node_id ( ) , & Init { features : nodes [ 2 ] . init_features ( ) , remote_network_address : None } ) . unwrap ( ) ;
1202+ nodes[ 2 ] . peer_connected ( & nodes[ 1 ] . get_our_node_id ( ) , & Init { features : nodes [ 1 ] . init_features ( ) , remote_network_address : None } ) . unwrap ( ) ;
12031203 chan_b_disconnected = false ;
12041204 }
12051205
0 commit comments