@@ -68,6 +68,7 @@ use crate::offers::nonce::Nonce;
68
68
use crate::offers::offer::{Offer, OfferBuilder};
69
69
use crate::offers::parse::Bolt12SemanticError;
70
70
use crate::offers::refund::{Refund, RefundBuilder};
71
+ use crate::offers::signer;
71
72
use crate::onion_message::async_payments::{AsyncPaymentsMessage, HeldHtlcAvailable, ReleaseHeldHtlc, AsyncPaymentsMessageHandler};
72
73
use crate::onion_message::messenger::{new_pending_onion_message, Destination, MessageRouter, PendingOnionMessage, Responder, ResponseInstruction};
73
74
use crate::onion_message::offers::{OffersMessage, OffersMessageHandler};
@@ -4227,7 +4228,7 @@ where
4227
4228
None if invoice.is_for_refund_without_paths() => {
4228
4229
invoice.verify_using_metadata(expanded_key, secp_ctx)
4229
4230
},
4230
- Some(&OffersContext::OutboundPayment { payment_id, nonce }) => {
4231
+ Some(&OffersContext::OutboundPayment { payment_id, nonce, .. }) => {
4231
4232
invoice.verify_using_payer_data(payment_id, nonce, expanded_key, secp_ctx)
4232
4233
},
4233
4234
_ => Err(()),
@@ -8886,7 +8887,8 @@ macro_rules! create_refund_builder { ($self: ident, $builder: ty) => {
8886
8887
let secp_ctx = &$self.secp_ctx;
8887
8888
8888
8889
let nonce = Nonce::from_entropy_source(entropy);
8889
- let context = OffersContext::OutboundPayment { payment_id, nonce };
8890
+ let hmac = signer::hmac_for_payment_id(payment_id, nonce, expanded_key);
8891
+ let context = OffersContext::OutboundPayment { payment_id, nonce, hmac };
8890
8892
let path = $self.create_blinded_paths_using_absolute_expiry(context, Some(absolute_expiry))
8891
8893
.and_then(|paths| paths.into_iter().next().ok_or(()))
8892
8894
.map_err(|_| Bolt12SemanticError::MissingPaths)?;
@@ -9021,7 +9023,8 @@ where
9021
9023
};
9022
9024
let invoice_request = builder.build_and_sign()?;
9023
9025
9024
- let context = OffersContext::OutboundPayment { payment_id, nonce };
9026
+ let hmac = signer::hmac_for_payment_id(payment_id, nonce, expanded_key);
9027
+ let context = OffersContext::OutboundPayment { payment_id, nonce, hmac };
9025
9028
let reply_paths = self.create_blinded_paths(context)
9026
9029
.map_err(|_| Bolt12SemanticError::MissingPaths)?;
9027
9030
0 commit comments