@@ -607,9 +607,9 @@ fn do_retry_with_no_persist(confirm_before_reload: bool) {
607607 let mut peer_state = per_peer_state. get ( & nodes[ 2 ] . node . get_our_node_id ( ) )
608608 . unwrap ( ) . lock ( ) . unwrap ( ) ;
609609 let mut channel = peer_state. channel_by_id . get_mut ( & chan_id_2) . unwrap ( ) ;
610- let mut new_config = channel. config ( ) ;
610+ let mut new_config = channel. context . config ( ) ;
611611 new_config. forwarding_fee_base_msat += 100_000 ;
612- channel. update_config ( & new_config) ;
612+ channel. context . update_config ( & new_config) ;
613613 new_route. paths [ 0 ] . hops [ 0 ] . fee_msat += 100_000 ;
614614 }
615615
@@ -1409,7 +1409,7 @@ fn test_trivial_inflight_htlc_tracking(){
14091409 let chan_1_used_liquidity = inflight_htlcs. used_liquidity_msat (
14101410 & NodeId :: from_pubkey ( & nodes[ 0 ] . node . get_our_node_id ( ) ) ,
14111411 & NodeId :: from_pubkey ( & nodes[ 1 ] . node . get_our_node_id ( ) ) ,
1412- channel_1. get_short_channel_id ( ) . unwrap ( )
1412+ channel_1. context . get_short_channel_id ( ) . unwrap ( )
14131413 ) ;
14141414 assert_eq ! ( chan_1_used_liquidity, None ) ;
14151415 }
@@ -1421,7 +1421,7 @@ fn test_trivial_inflight_htlc_tracking(){
14211421 let chan_2_used_liquidity = inflight_htlcs. used_liquidity_msat (
14221422 & NodeId :: from_pubkey ( & nodes[ 1 ] . node . get_our_node_id ( ) ) ,
14231423 & NodeId :: from_pubkey ( & nodes[ 2 ] . node . get_our_node_id ( ) ) ,
1424- channel_2. get_short_channel_id ( ) . unwrap ( )
1424+ channel_2. context . get_short_channel_id ( ) . unwrap ( )
14251425 ) ;
14261426
14271427 assert_eq ! ( chan_2_used_liquidity, None ) ;
@@ -1446,7 +1446,7 @@ fn test_trivial_inflight_htlc_tracking(){
14461446 let chan_1_used_liquidity = inflight_htlcs. used_liquidity_msat (
14471447 & NodeId :: from_pubkey ( & nodes[ 0 ] . node . get_our_node_id ( ) ) ,
14481448 & NodeId :: from_pubkey ( & nodes[ 1 ] . node . get_our_node_id ( ) ) ,
1449- channel_1. get_short_channel_id ( ) . unwrap ( )
1449+ channel_1. context . get_short_channel_id ( ) . unwrap ( )
14501450 ) ;
14511451 // First hop accounts for expected 1000 msat fee
14521452 assert_eq ! ( chan_1_used_liquidity, Some ( 501000 ) ) ;
@@ -1459,7 +1459,7 @@ fn test_trivial_inflight_htlc_tracking(){
14591459 let chan_2_used_liquidity = inflight_htlcs. used_liquidity_msat (
14601460 & NodeId :: from_pubkey ( & nodes[ 1 ] . node . get_our_node_id ( ) ) ,
14611461 & NodeId :: from_pubkey ( & nodes[ 2 ] . node . get_our_node_id ( ) ) ,
1462- channel_2. get_short_channel_id ( ) . unwrap ( )
1462+ channel_2. context . get_short_channel_id ( ) . unwrap ( )
14631463 ) ;
14641464
14651465 assert_eq ! ( chan_2_used_liquidity, Some ( 500000 ) ) ;
@@ -1485,7 +1485,7 @@ fn test_trivial_inflight_htlc_tracking(){
14851485 let chan_1_used_liquidity = inflight_htlcs. used_liquidity_msat (
14861486 & NodeId :: from_pubkey ( & nodes[ 0 ] . node . get_our_node_id ( ) ) ,
14871487 & NodeId :: from_pubkey ( & nodes[ 1 ] . node . get_our_node_id ( ) ) ,
1488- channel_1. get_short_channel_id ( ) . unwrap ( )
1488+ channel_1. context . get_short_channel_id ( ) . unwrap ( )
14891489 ) ;
14901490 assert_eq ! ( chan_1_used_liquidity, None ) ;
14911491 }
@@ -1497,7 +1497,7 @@ fn test_trivial_inflight_htlc_tracking(){
14971497 let chan_2_used_liquidity = inflight_htlcs. used_liquidity_msat (
14981498 & NodeId :: from_pubkey ( & nodes[ 1 ] . node . get_our_node_id ( ) ) ,
14991499 & NodeId :: from_pubkey ( & nodes[ 2 ] . node . get_our_node_id ( ) ) ,
1500- channel_2. get_short_channel_id ( ) . unwrap ( )
1500+ channel_2. context . get_short_channel_id ( ) . unwrap ( )
15011501 ) ;
15021502 assert_eq ! ( chan_2_used_liquidity, None ) ;
15031503 }
@@ -1538,7 +1538,7 @@ fn test_holding_cell_inflight_htlcs() {
15381538 let used_liquidity = inflight_htlcs. used_liquidity_msat (
15391539 & NodeId :: from_pubkey ( & nodes[ 0 ] . node . get_our_node_id ( ) ) ,
15401540 & NodeId :: from_pubkey ( & nodes[ 1 ] . node . get_our_node_id ( ) ) ,
1541- channel. get_short_channel_id ( ) . unwrap ( )
1541+ channel. context . get_short_channel_id ( ) . unwrap ( )
15421542 ) ;
15431543
15441544 assert_eq ! ( used_liquidity, Some ( 2000000 ) ) ;
@@ -1635,7 +1635,9 @@ fn do_test_intercepted_payment(test: InterceptTest) {
16351635
16361636 // Check for unknown channel id error.
16371637 let unknown_chan_id_err = nodes[ 1 ] . node . forward_intercepted_htlc ( intercept_id, & [ 42 ; 32 ] , nodes[ 2 ] . node . get_our_node_id ( ) , expected_outbound_amount_msat) . unwrap_err ( ) ;
1638- assert_eq ! ( unknown_chan_id_err , APIError :: ChannelUnavailable { err: format!( "Channel with id {} not found for the passed counterparty node_id {}" , log_bytes!( [ 42 ; 32 ] ) , nodes[ 2 ] . node. get_our_node_id( ) ) } ) ;
1638+ assert_eq ! ( unknown_chan_id_err , APIError :: ChannelUnavailable {
1639+ err: format!( "Funded channel with id {} not found for the passed counterparty node_id {}. Channel may still be opening." ,
1640+ log_bytes!( [ 42 ; 32 ] ) , nodes[ 2 ] . node. get_our_node_id( ) ) } ) ;
16391641
16401642 if test == InterceptTest :: Fail {
16411643 // Ensure we can fail the intercepted payment back.
@@ -1659,7 +1661,9 @@ fn do_test_intercepted_payment(test: InterceptTest) {
16591661 // Check that we'll fail as expected when sending to a channel that isn't in `ChannelReady` yet.
16601662 let temp_chan_id = nodes[ 1 ] . node . create_channel ( nodes[ 2 ] . node . get_our_node_id ( ) , 100_000 , 0 , 42 , None ) . unwrap ( ) ;
16611663 let unusable_chan_err = nodes[ 1 ] . node . forward_intercepted_htlc ( intercept_id, & temp_chan_id, nodes[ 2 ] . node . get_our_node_id ( ) , expected_outbound_amount_msat) . unwrap_err ( ) ;
1662- assert_eq ! ( unusable_chan_err , APIError :: ChannelUnavailable { err: format!( "Channel with id {} not fully established" , log_bytes!( temp_chan_id) ) } ) ;
1664+ assert_eq ! ( unusable_chan_err , APIError :: ChannelUnavailable {
1665+ err: format!( "Funded channel with id {} not found for the passed counterparty node_id {}. Channel may still be opening." ,
1666+ log_bytes!( temp_chan_id) , nodes[ 2 ] . node. get_our_node_id( ) ) } ) ;
16631667 assert_eq ! ( nodes[ 1 ] . node. get_and_clear_pending_msg_events( ) . len( ) , 1 ) ;
16641668
16651669 // Open the just-in-time channel so the payment can then be forwarded.
0 commit comments