@@ -34,20 +34,11 @@ pub struct PaymentDetails {
3434 pub direction : PaymentDirection ,
3535 /// The status of the payment.
3636 pub status : PaymentStatus ,
37- /// Limits applying to how much fee we allow an LSP to deduct from the payment amount.
38- ///
39- /// This is only `Some` for payments received via a JIT-channel, in which case the first
40- /// inbound payment will pay for the LSP's channel opening fees.
41- ///
42- /// See [`LdkChannelConfig::accept_underpaying_htlcs`] for more information.
43- ///
44- /// [`LdkChannelConfig::accept_underpaying_htlcs`]: lightning::util::config::ChannelConfig::accept_underpaying_htlcs
45- pub lsp_fee_limits : Option < LSPFeeLimits > ,
4637}
4738
4839impl_writeable_tlv_based ! ( PaymentDetails , {
4940 ( 0 , hash, required) ,
50- ( 1 , lsp_fee_limits, option ) ,
41+ // 1 briefly used to be lsp_fee_limits, could probably be reused at some point in the future.
5142 ( 2 , preimage, required) ,
5243 ( 3 , kind, option) ,
5344 ( 4 , secret, required) ,
@@ -97,6 +88,22 @@ pub enum PaymentKind {
9788 /// [BOLT 11]: https://github.com/lightning/bolts/blob/master/11-payment-encoding.md
9889 // TODO: Bolt11 { invoice: Option<Bolt11Invoice> },
9990 Bolt11 ,
91+ /// A [BOLT 11] payment intended to open an [LSPS 2] just-in-time channel.
92+ ///
93+ /// [BOLT 11]: https://github.com/lightning/bolts/blob/master/11-payment-encoding.md
94+ /// [LSPS 2]: https://github.com/BitcoinAndLightningLayerSpecs/lsp/blob/main/LSPS2/README.md
95+ // TODO: Bolt11Jit { invoice: Option<Bolt11Invoice> },
96+ Bolt11Jit {
97+ /// Limits applying to how much fee we allow an LSP to deduct from the payment amount.
98+ ///
99+ /// This is only `Some` for payments received via a JIT-channel, in which case the first
100+ /// inbound payment will pay for the LSP's channel opening fees.
101+ ///
102+ /// See [`LdkChannelConfig::accept_underpaying_htlcs`] for more information.
103+ ///
104+ /// [`LdkChannelConfig::accept_underpaying_htlcs`]: lightning::util::config::ChannelConfig::accept_underpaying_htlcs
105+ lsp_fee_limits : Option < LSPFeeLimits > ,
106+ } ,
100107 /// A spontaneous ("keysend") payment.
101108 Spontaneous ,
102109}
@@ -106,7 +113,10 @@ impl_writeable_tlv_based_enum!(PaymentKind,
106113 ( 2 , Bolt11 ) => {
107114 // TODO: (0, invoice, option),
108115 } ,
109- ( 6 , Spontaneous ) => { } ;
116+ ( 4 , Bolt11Jit ) => {
117+ ( 1 , lsp_fee_limits, option) ,
118+ } ,
119+ ( 8 , Spontaneous ) => { } ;
110120) ;
111121
112122/// Limits applying to how much fee we allow an LSP to deduct from the payment amount.
@@ -137,7 +147,6 @@ pub(crate) struct PaymentDetailsUpdate {
137147 pub amount_msat : Option < Option < u64 > > ,
138148 pub direction : Option < PaymentDirection > ,
139149 pub status : Option < PaymentStatus > ,
140- pub lsp_fee_limits : Option < Option < LSPFeeLimits > > ,
141150}
142151
143152impl PaymentDetailsUpdate {
@@ -149,7 +158,6 @@ impl PaymentDetailsUpdate {
149158 amount_msat : None ,
150159 direction : None ,
151160 status : None ,
152- lsp_fee_limits : None ,
153161 }
154162 }
155163}
@@ -230,10 +238,6 @@ where
230238 payment. status = status;
231239 }
232240
233- if let Some ( lsp_fee_limits) = update. lsp_fee_limits {
234- payment. lsp_fee_limits = lsp_fee_limits
235- }
236-
237241 self . persist_info ( & update. hash , payment) ?;
238242 updated = true ;
239243 }
0 commit comments