From 681bd5af34c080e10c252bae18ad4ad40c4f465a 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..a594230c0e5 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::Unknown {}); + responder.respond_with_reply_path(OffersMessage::Invoice(invoice), context) + }, Err(error) => responder.respond(OffersMessage::InvoiceError(error.into())), } },