Skip to content

Commit 20d0171

Browse files
committed
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.
1 parent bc91d1a commit 20d0171

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10927,7 +10927,12 @@ where
1092710927
};
1092810928

1092910929
match response {
10930-
Ok(invoice) => Some((OffersMessage::Invoice(invoice), responder.respond())),
10930+
Ok(invoice) => {
10931+
let nonce = nonce.unwrap_or_else(|| Nonce::from_entropy_source(&*self.entropy_source));
10932+
let hmac = signer::hmac_for_payment_hash(payment_hash, nonce, expanded_key);
10933+
let context = MessageContext::Offers(OffersContext::InboundPayment { payment_hash, nonce, hmac });
10934+
Some((OffersMessage::Invoice(invoice), responder.respond_with_reply_path(context)))
10935+
},
1093110936
Err(error) => Some((OffersMessage::InvoiceError(error.into()), responder.respond())),
1093210937
}
1093310938
},

0 commit comments

Comments
 (0)