From d535fa1a3d7ab3f2825ba3183ba80cc9fd481777 Mon Sep 17 00:00:00 2001 From: shaavan Date: Tue, 9 Jul 2024 19:29:35 +0530 Subject: [PATCH] Add reply_path to BOLT12Invoices in Offers Flow 1. Introduced reply_path in BOLT12Invoices to address a gap in error handling. Previously, if a BOLT12Invoice sent in the offers flow generated an Invoice Error, the payer had no way to send this error back to the payee. 2. By adding a reply_path to the Invoice Message, the payer can now communicate any errors back to the payee, ensuring better error handling and communication within the offers flow. --- lightning/src/ln/channelmanager.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs index 167ab0ac8fd..9331b7b1dc1 100644 --- a/lightning/src/ln/channelmanager.rs +++ b/lightning/src/ln/channelmanager.rs @@ -10852,7 +10852,10 @@ where }; match response { - Ok(invoice) => responder.respond(OffersMessage::Invoice(invoice)), + Ok(invoice) => { + let context = MessageContext::Offers(OffersContext::InboundPayment { payment_hash }); + responder.respond_with_reply_path(OffersMessage::Invoice(invoice), context) + }, Err(error) => responder.respond(OffersMessage::InvoiceError(error.into())), } },