File tree 3 files changed +29
-5
lines changed 3 files changed +29
-5
lines changed Original file line number Diff line number Diff line change @@ -1093,6 +1093,11 @@ fn build_with_store_internal(
1093
1093
1094
1094
// If we act as an LSPS2 service, we allow forwarding to unnannounced channels.
1095
1095
user_config. accept_forwards_to_priv_channels = true ;
1096
+
1097
+ // If we act as an LSPS2 service, set the HTLC-value-in-flight to 100% of the channel value
1098
+ // to ensure we can forward the initial payment.
1099
+ user_config. channel_handshake_config . max_inbound_htlc_value_in_flight_percent_of_channel =
1100
+ 100 ;
1096
1101
}
1097
1102
1098
1103
let message_router =
Original file line number Diff line number Diff line change @@ -675,11 +675,14 @@ where
675
675
676
676
let mut config = * self . channel_manager . get_current_default_configuration ( ) ;
677
677
678
- // Set the HTLC-value-in-flight to 100% of the channel value to ensure we can
679
- // forward the payment.
680
- config
681
- . channel_handshake_config
682
- . max_inbound_htlc_value_in_flight_percent_of_channel = 100 ;
678
+ // We set these LSP-specific values during Node building, here we're making sure it's actually set.
679
+ debug_assert_eq ! (
680
+ config
681
+ . channel_handshake_config
682
+ . max_inbound_htlc_value_in_flight_percent_of_channel,
683
+ 100
684
+ ) ;
685
+ debug_assert ! ( config. accept_forwards_to_priv_channels) ;
683
686
684
687
// We set the forwarding fee to 0 for now as we're getting paid by the channel fee.
685
688
//
Original file line number Diff line number Diff line change @@ -1145,6 +1145,22 @@ fn lsps2_client_service_integration() {
1145
1145
( expected_received_amount_msat + expected_channel_overprovisioning_msat) / 1000 ;
1146
1146
let channel_value_sats = client_node. list_channels ( ) . first ( ) . unwrap ( ) . channel_value_sats ;
1147
1147
assert_eq ! ( channel_value_sats, expected_channel_size_sat) ;
1148
+
1149
+ println ! ( "Generating regular invoice!" ) ;
1150
+ let invoice_description =
1151
+ Bolt11InvoiceDescription :: Direct ( Description :: new ( String :: from ( "asdf" ) ) . unwrap ( ) ) ;
1152
+ let amount_msat = 5_000_000 ;
1153
+ let invoice = client_node
1154
+ . bolt11_payment ( )
1155
+ . receive ( amount_msat, & invoice_description. into ( ) , 1024 )
1156
+ . unwrap ( ) ;
1157
+
1158
+ // Have the payer_node pay the invoice, to check regular forwards service_node -> client_node
1159
+ // are working as expected.
1160
+ println ! ( "Paying regular invoice!" ) ;
1161
+ let payment_id = payer_node. bolt11_payment ( ) . send ( & invoice, None ) . unwrap ( ) ;
1162
+ expect_payment_successful_event ! ( payer_node, Some ( payment_id) , None ) ;
1163
+ expect_payment_received_event ! ( client_node, amount_msat) ;
1148
1164
}
1149
1165
1150
1166
#[ test]
You can’t perform that action at this time.
0 commit comments