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