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