@@ -176,10 +176,19 @@ impl Bolt11Payment {
176176 let amt_msat = invoice. amount_milli_satoshis ( ) . unwrap ( ) ;
177177 log_info ! ( self . logger, "Initiated sending {}msat to {}" , amt_msat, payee_pubkey) ;
178178
179+ // Extract description from the invoice
180+ let description = match invoice. description ( ) {
181+ lightning_invoice:: Bolt11InvoiceDescriptionRef :: Direct ( desc) => Some ( desc. to_string ( ) ) ,
182+ lightning_invoice:: Bolt11InvoiceDescriptionRef :: Hash ( hash) => {
183+ Some ( crate :: hex_utils:: to_string ( hash. 0 . as_ref ( ) ) )
184+ } ,
185+ } ;
186+
179187 let kind = PaymentKind :: Bolt11 {
180188 hash : payment_hash,
181189 preimage : None ,
182190 secret : payment_secret,
191+ description,
183192 } ;
184193 let payment = PaymentDetails :: new (
185194 payment_id,
@@ -199,10 +208,19 @@ impl Bolt11Payment {
199208 match e {
200209 RetryableSendFailure :: DuplicatePayment => Err ( Error :: DuplicatePayment ) ,
201210 _ => {
211+ // Extract description from the invoice
212+ let description = match invoice. description ( ) {
213+ lightning_invoice:: Bolt11InvoiceDescriptionRef :: Direct ( desc) => Some ( desc. to_string ( ) ) ,
214+ lightning_invoice:: Bolt11InvoiceDescriptionRef :: Hash ( hash) => {
215+ Some ( crate :: hex_utils:: to_string ( hash. 0 . as_ref ( ) ) )
216+ } ,
217+ } ;
218+
202219 let kind = PaymentKind :: Bolt11 {
203220 hash : payment_hash,
204221 preimage : None ,
205222 secret : payment_secret,
223+ description,
206224 } ;
207225 let payment = PaymentDetails :: new (
208226 payment_id,
@@ -311,10 +329,19 @@ impl Bolt11Payment {
311329 payee_pubkey
312330 ) ;
313331
332+ // Extract description from the invoice
333+ let description = match invoice. description ( ) {
334+ lightning_invoice:: Bolt11InvoiceDescriptionRef :: Direct ( desc) => Some ( desc. to_string ( ) ) ,
335+ lightning_invoice:: Bolt11InvoiceDescriptionRef :: Hash ( hash) => {
336+ Some ( crate :: hex_utils:: to_string ( hash. 0 . as_ref ( ) ) )
337+ } ,
338+ } ;
339+
314340 let kind = PaymentKind :: Bolt11 {
315341 hash : payment_hash,
316342 preimage : None ,
317343 secret : Some ( * payment_secret) ,
344+ description,
318345 } ;
319346
320347 let payment = PaymentDetails :: new (
@@ -335,10 +362,19 @@ impl Bolt11Payment {
335362 match e {
336363 RetryableSendFailure :: DuplicatePayment => Err ( Error :: DuplicatePayment ) ,
337364 _ => {
365+ // Extract description from the invoice
366+ let description = match invoice. description ( ) {
367+ lightning_invoice:: Bolt11InvoiceDescriptionRef :: Direct ( desc) => Some ( desc. to_string ( ) ) ,
368+ lightning_invoice:: Bolt11InvoiceDescriptionRef :: Hash ( hash) => {
369+ Some ( crate :: hex_utils:: to_string ( hash. 0 . as_ref ( ) ) )
370+ } ,
371+ } ;
372+
338373 let kind = PaymentKind :: Bolt11 {
339374 hash : payment_hash,
340375 preimage : None ,
341376 secret : Some ( * payment_secret) ,
377+ description,
342378 } ;
343379 let payment = PaymentDetails :: new (
344380 payment_id,
@@ -569,10 +605,20 @@ impl Bolt11Payment {
569605 } else {
570606 None
571607 } ;
608+
609+ // Extract description from the invoice
610+ let description = match invoice. description ( ) {
611+ lightning_invoice:: Bolt11InvoiceDescriptionRef :: Direct ( desc) => Some ( desc. to_string ( ) ) ,
612+ lightning_invoice:: Bolt11InvoiceDescriptionRef :: Hash ( hash) => {
613+ Some ( crate :: hex_utils:: to_string ( hash. 0 . as_ref ( ) ) )
614+ } ,
615+ } ;
616+
572617 let kind = PaymentKind :: Bolt11 {
573618 hash : payment_hash,
574619 preimage,
575620 secret : Some ( payment_secret. clone ( ) ) ,
621+ description,
576622 } ;
577623 let payment = PaymentDetails :: new (
578624 id,
@@ -705,12 +751,22 @@ impl Bolt11Payment {
705751 let id = PaymentId ( payment_hash. 0 ) ;
706752 let preimage =
707753 self . channel_manager . get_payment_preimage ( payment_hash, payment_secret. clone ( ) ) . ok ( ) ;
754+
755+ // Extract description from the invoice
756+ let description = match invoice. description ( ) {
757+ lightning_invoice:: Bolt11InvoiceDescriptionRef :: Direct ( desc) => Some ( desc. to_string ( ) ) ,
758+ lightning_invoice:: Bolt11InvoiceDescriptionRef :: Hash ( hash) => {
759+ Some ( crate :: hex_utils:: to_string ( hash. 0 . as_ref ( ) ) )
760+ } ,
761+ } ;
762+
708763 let kind = PaymentKind :: Bolt11Jit {
709764 hash : payment_hash,
710765 preimage,
711766 secret : Some ( payment_secret. clone ( ) ) ,
712767 counterparty_skimmed_fee_msat : None ,
713768 lsp_fee_limits,
769+ description,
714770 } ;
715771 let payment = PaymentDetails :: new (
716772 id,
0 commit comments