@@ -8375,7 +8375,7 @@ macro_rules! create_offer_builder { ($self: ident, $builder: ty) => {
8375
8375
let entropy = &*$self.entropy_source;
8376
8376
let secp_ctx = &$self.secp_ctx;
8377
8377
8378
- let path = $self.create_blinded_path_using_absolute_expiry(absolute_expiry)
8378
+ let path = $self.create_blinded_path_using_absolute_expiry(absolute_expiry, None )
8379
8379
.map_err(|_| Bolt12SemanticError::MissingPaths)?;
8380
8380
let builder = OfferBuilder::deriving_signing_pubkey(
8381
8381
node_id, expanded_key, entropy, secp_ctx
@@ -8447,7 +8447,7 @@ macro_rules! create_refund_builder { ($self: ident, $builder: ty) => {
8447
8447
let entropy = &*$self.entropy_source;
8448
8448
let secp_ctx = &$self.secp_ctx;
8449
8449
8450
- let path = $self.create_blinded_path_using_absolute_expiry(Some(absolute_expiry))
8450
+ let path = $self.create_blinded_path_using_absolute_expiry(Some(absolute_expiry), Some(payment_id) )
8451
8451
.map_err(|_| Bolt12SemanticError::MissingPaths)?;
8452
8452
let builder = RefundBuilder::deriving_payer_id(
8453
8453
node_id, expanded_key, entropy, secp_ctx, amount_msats, payment_id
@@ -8570,7 +8570,7 @@ where
8570
8570
Some(payer_note) => builder.payer_note(payer_note),
8571
8571
};
8572
8572
let invoice_request = builder.build_and_sign()?;
8573
- let reply_path = self.create_blinded_path().map_err(|_| Bolt12SemanticError::MissingPaths)?;
8573
+ let reply_path = self.create_blinded_path(Some(payment_id) ).map_err(|_| Bolt12SemanticError::MissingPaths)?;
8574
8574
8575
8575
let _persistence_guard = PersistenceNotifierGuard::notify_on_drop(self);
8576
8576
@@ -8670,7 +8670,7 @@ where
8670
8670
)?;
8671
8671
let builder: InvoiceBuilder<DerivedSigningPubkey> = builder.into();
8672
8672
let invoice = builder.allow_mpp().build_and_sign(secp_ctx)?;
8673
- let reply_path = self.create_blinded_path()
8673
+ let reply_path = self.create_blinded_path(None )
8674
8674
.map_err(|_| Bolt12SemanticError::MissingPaths)?;
8675
8675
8676
8676
let mut pending_offers_messages = self.pending_offers_messages.lock().unwrap();
@@ -8803,15 +8803,15 @@ where
8803
8803
/// respectively, based on the given `absolute_expiry` as seconds since the Unix epoch. See
8804
8804
/// [`MAX_SHORT_LIVED_RELATIVE_EXPIRY`].
8805
8805
fn create_blinded_path_using_absolute_expiry(
8806
- &self, absolute_expiry: Option<Duration>
8806
+ &self, absolute_expiry: Option<Duration>, payment_id: Option<PaymentId>
8807
8807
) -> Result<BlindedPath, ()> {
8808
8808
let now = self.duration_since_epoch();
8809
8809
let max_short_lived_absolute_expiry = now.saturating_add(MAX_SHORT_LIVED_RELATIVE_EXPIRY);
8810
8810
8811
8811
if absolute_expiry.unwrap_or(Duration::MAX) <= max_short_lived_absolute_expiry {
8812
- self.create_compact_blinded_path()
8812
+ self.create_compact_blinded_path(payment_id )
8813
8813
} else {
8814
- self.create_blinded_path()
8814
+ self.create_blinded_path(payment_id )
8815
8815
}
8816
8816
}
8817
8817
@@ -8831,7 +8831,7 @@ where
8831
8831
/// Creates a blinded path by delegating to [`MessageRouter::create_blinded_paths`].
8832
8832
///
8833
8833
/// Errors if the `MessageRouter` errors or returns an empty `Vec`.
8834
- fn create_blinded_path(&self) -> Result<BlindedPath, ()> {
8834
+ fn create_blinded_path(&self, payment_id: Option<PaymentId> ) -> Result<BlindedPath, ()> {
8835
8835
let recipient = self.get_our_node_id();
8836
8836
let secp_ctx = &self.secp_ctx;
8837
8837
@@ -8844,14 +8844,14 @@ where
8844
8844
.collect::<Vec<_>>();
8845
8845
8846
8846
self.router
8847
- .create_blinded_paths(recipient, peers, secp_ctx)
8847
+ .create_blinded_paths(recipient, peers, secp_ctx, payment_id )
8848
8848
.and_then(|paths| paths.into_iter().next().ok_or(()))
8849
8849
}
8850
8850
8851
8851
/// Creates a blinded path by delegating to [`MessageRouter::create_compact_blinded_paths`].
8852
8852
///
8853
8853
/// Errors if the `MessageRouter` errors or returns an empty `Vec`.
8854
- fn create_compact_blinded_path(&self) -> Result<BlindedPath, ()> {
8854
+ fn create_compact_blinded_path(&self, payment_id: Option<PaymentId> ) -> Result<BlindedPath, ()> {
8855
8855
let recipient = self.get_our_node_id();
8856
8856
let secp_ctx = &self.secp_ctx;
8857
8857
@@ -8871,7 +8871,7 @@ where
8871
8871
.collect::<Vec<_>>();
8872
8872
8873
8873
self.router
8874
- .create_compact_blinded_paths(recipient, peers, secp_ctx)
8874
+ .create_compact_blinded_paths(recipient, peers, secp_ctx, payment_id )
8875
8875
.and_then(|paths| paths.into_iter().next().ok_or(()))
8876
8876
}
8877
8877
@@ -10252,7 +10252,9 @@ where
10252
10252
R::Target: Router,
10253
10253
L::Target: Logger,
10254
10254
{
10255
- fn handle_message(&self, message: OffersMessage, responder: Option<Responder>) -> ResponseInstruction<OffersMessage> {
10255
+ fn handle_message(
10256
+ &self, message: OffersMessage, responder: Option<Responder>, _payment_id: Option<PaymentId>
10257
+ ) -> ResponseInstruction<OffersMessage> {
10256
10258
let secp_ctx = &self.secp_ctx;
10257
10259
let expanded_key = &self.inbound_payment_key;
10258
10260
0 commit comments