@@ -607,9 +607,9 @@ fn do_retry_with_no_persist(confirm_before_reload: bool) {
607
607
let mut peer_state = per_peer_state. get ( & nodes[ 2 ] . node . get_our_node_id ( ) )
608
608
. unwrap ( ) . lock ( ) . unwrap ( ) ;
609
609
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 ( ) ;
611
611
new_config. forwarding_fee_base_msat += 100_000 ;
612
- channel. update_config ( & new_config) ;
612
+ channel. context . update_config ( & new_config) ;
613
613
new_route. paths [ 0 ] . hops [ 0 ] . fee_msat += 100_000 ;
614
614
}
615
615
@@ -1409,7 +1409,7 @@ fn test_trivial_inflight_htlc_tracking(){
1409
1409
let chan_1_used_liquidity = inflight_htlcs. used_liquidity_msat (
1410
1410
& NodeId :: from_pubkey ( & nodes[ 0 ] . node . get_our_node_id ( ) ) ,
1411
1411
& 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 ( )
1413
1413
) ;
1414
1414
assert_eq ! ( chan_1_used_liquidity, None ) ;
1415
1415
}
@@ -1421,7 +1421,7 @@ fn test_trivial_inflight_htlc_tracking(){
1421
1421
let chan_2_used_liquidity = inflight_htlcs. used_liquidity_msat (
1422
1422
& NodeId :: from_pubkey ( & nodes[ 1 ] . node . get_our_node_id ( ) ) ,
1423
1423
& 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 ( )
1425
1425
) ;
1426
1426
1427
1427
assert_eq ! ( chan_2_used_liquidity, None ) ;
@@ -1446,7 +1446,7 @@ fn test_trivial_inflight_htlc_tracking(){
1446
1446
let chan_1_used_liquidity = inflight_htlcs. used_liquidity_msat (
1447
1447
& NodeId :: from_pubkey ( & nodes[ 0 ] . node . get_our_node_id ( ) ) ,
1448
1448
& 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 ( )
1450
1450
) ;
1451
1451
// First hop accounts for expected 1000 msat fee
1452
1452
assert_eq ! ( chan_1_used_liquidity, Some ( 501000 ) ) ;
@@ -1459,7 +1459,7 @@ fn test_trivial_inflight_htlc_tracking(){
1459
1459
let chan_2_used_liquidity = inflight_htlcs. used_liquidity_msat (
1460
1460
& NodeId :: from_pubkey ( & nodes[ 1 ] . node . get_our_node_id ( ) ) ,
1461
1461
& 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 ( )
1463
1463
) ;
1464
1464
1465
1465
assert_eq ! ( chan_2_used_liquidity, Some ( 500000 ) ) ;
@@ -1485,7 +1485,7 @@ fn test_trivial_inflight_htlc_tracking(){
1485
1485
let chan_1_used_liquidity = inflight_htlcs. used_liquidity_msat (
1486
1486
& NodeId :: from_pubkey ( & nodes[ 0 ] . node . get_our_node_id ( ) ) ,
1487
1487
& 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 ( )
1489
1489
) ;
1490
1490
assert_eq ! ( chan_1_used_liquidity, None ) ;
1491
1491
}
@@ -1497,7 +1497,7 @@ fn test_trivial_inflight_htlc_tracking(){
1497
1497
let chan_2_used_liquidity = inflight_htlcs. used_liquidity_msat (
1498
1498
& NodeId :: from_pubkey ( & nodes[ 1 ] . node . get_our_node_id ( ) ) ,
1499
1499
& 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 ( )
1501
1501
) ;
1502
1502
assert_eq ! ( chan_2_used_liquidity, None ) ;
1503
1503
}
@@ -1538,7 +1538,7 @@ fn test_holding_cell_inflight_htlcs() {
1538
1538
let used_liquidity = inflight_htlcs. used_liquidity_msat (
1539
1539
& NodeId :: from_pubkey ( & nodes[ 0 ] . node . get_our_node_id ( ) ) ,
1540
1540
& 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 ( )
1542
1542
) ;
1543
1543
1544
1544
assert_eq ! ( used_liquidity, Some ( 2000000 ) ) ;
@@ -1635,7 +1635,9 @@ fn do_test_intercepted_payment(test: InterceptTest) {
1635
1635
1636
1636
// Check for unknown channel id error.
1637
1637
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( ) ) } ) ;
1639
1641
1640
1642
if test == InterceptTest :: Fail {
1641
1643
// Ensure we can fail the intercepted payment back.
@@ -1659,7 +1661,9 @@ fn do_test_intercepted_payment(test: InterceptTest) {
1659
1661
// Check that we'll fail as expected when sending to a channel that isn't in `ChannelReady` yet.
1660
1662
let temp_chan_id = nodes[ 1 ] . node . create_channel ( nodes[ 2 ] . node . get_our_node_id ( ) , 100_000 , 0 , 42 , None ) . unwrap ( ) ;
1661
1663
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( ) ) } ) ;
1663
1667
assert_eq ! ( nodes[ 1 ] . node. get_and_clear_pending_msg_events( ) . len( ) , 1 ) ;
1664
1668
1665
1669
// Open the just-in-time channel so the payment can then be forwarded.
0 commit comments