]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Include payment hash in Bolt12Invoice reply path
authorJeffrey Czyz <jkczyz@gmail.com>
Tue, 23 Jul 2024 18:49:37 +0000 (13:49 -0500)
committerJeffrey Czyz <jkczyz@gmail.com>
Tue, 30 Jul 2024 21:06:25 +0000 (16:06 -0500)
Instead of using OffersContext::Unknown for the Bolt12Invoice reply path
use OffersContext::InboundPayment to include the payment hash.
OffersContext::Unknown will be removed in another commit.

lightning/src/ln/channelmanager.rs

index b57dee302567c867b42aeaaf3c204583c23f9629..c316dc2b4847a432aded0ce411e17dabad7aaf32 100644 (file)
@@ -9117,7 +9117,11 @@ where
                                )?;
                                let builder: InvoiceBuilder<DerivedSigningPubkey> = builder.into();
                                let invoice = builder.allow_mpp().build_and_sign(secp_ctx)?;
-                               let reply_paths = self.create_blinded_paths(OffersContext::Unknown {})
+
+                               let context = OffersContext::InboundPayment {
+                                       payment_hash: invoice.payment_hash(),
+                               };
+                               let reply_paths = self.create_blinded_paths(context)
                                        .map_err(|_| Bolt12SemanticError::MissingPaths)?;
 
                                let mut pending_offers_messages = self.pending_offers_messages.lock().unwrap();