@@ -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};
@@ -4222,7 +4223,7 @@ where
4222
4223
None if invoice.is_for_refund_without_paths() => {
4223
4224
invoice.verify_using_metadata(expanded_key, secp_ctx)
4224
4225
},
4225
- Some(&OffersContext::OutboundPayment { payment_id, nonce }) => {
4226
+ Some(&OffersContext::OutboundPayment { payment_id, nonce, .. }) => {
4226
4227
invoice.verify_using_payer_data(payment_id, nonce, expanded_key, secp_ctx)
4227
4228
},
4228
4229
_ => Err(()),
@@ -8879,7 +8880,8 @@ macro_rules! create_refund_builder { ($self: ident, $builder: ty) => {
8879
8880
let secp_ctx = &$self.secp_ctx;
8880
8881
8881
8882
let nonce = Nonce::from_entropy_source(entropy);
8882
- let context = OffersContext::OutboundPayment { payment_id, nonce };
8883
+ let hmac = signer::hmac_for_payment_id(payment_id, nonce, expanded_key);
8884
+ let context = OffersContext::OutboundPayment { payment_id, nonce, hmac };
8883
8885
let path = $self.create_blinded_paths_using_absolute_expiry(context, Some(absolute_expiry))
8884
8886
.and_then(|paths| paths.into_iter().next().ok_or(()))
8885
8887
.map_err(|_| Bolt12SemanticError::MissingPaths)?;
@@ -9014,7 +9016,8 @@ where
9014
9016
};
9015
9017
let invoice_request = builder.build_and_sign()?;
9016
9018
9017
- let context = OffersContext::OutboundPayment { payment_id, nonce };
9019
+ let hmac = signer::hmac_for_payment_id(payment_id, nonce, expanded_key);
9020
+ let context = OffersContext::OutboundPayment { payment_id, nonce, hmac };
9018
9021
let reply_paths = self.create_blinded_paths(context)
9019
9022
.map_err(|_| Bolt12SemanticError::MissingPaths)?;
9020
9023
0 commit comments