@@ -33,7 +33,7 @@ use bitcoin::secp256k1::Secp256k1;
3333use bitcoin::{secp256k1, Sequence, Weight};
3434
3535use crate::events::FundingInfo;
36- use crate::blinded_path::message::{AsyncPaymentsContext, MessageContext, MessageForwardNode, OffersContext };
36+ use crate::blinded_path::message::{AsyncPaymentsContext, MessageContext, MessageForwardNode};
3737use crate::blinded_path::NodeIdLookUp;
3838use crate::blinded_path::message::BlindedMessagePath;
3939use crate::blinded_path::payment::{BlindedPaymentPath, PaymentConstraints, PaymentContext, UnauthenticatedReceiveTlvs};
@@ -443,11 +443,15 @@ impl Ord for ClaimableHTLC {
443443pub trait Verification {
444444 /// Constructs an HMAC to include in [`OffersContext`] for the data along with the given
445445 /// [`Nonce`].
446+ ///
447+ /// [`OffersContext`]: crate::blinded_path::message::OffersContext
446448 fn hmac_for_offer_payment(
447449 &self, nonce: Nonce, expanded_key: &inbound_payment::ExpandedKey,
448450 ) -> Hmac<Sha256>;
449451
450452 /// Authenticates the data using an HMAC and a [`Nonce`] taken from an [`OffersContext`].
453+ ///
454+ /// [`OffersContext`]: crate::blinded_path::message::OffersContext
451455 fn verify_for_offer_payment(
452456 &self, hmac: Hmac<Sha256>, nonce: Nonce, expanded_key: &inbound_payment::ExpandedKey,
453457 ) -> Result<(), ()>;
@@ -456,6 +460,8 @@ pub trait Verification {
456460impl Verification for PaymentHash {
457461 /// Constructs an HMAC to include in [`OffersContext::InboundPayment`] for the payment hash
458462 /// along with the given [`Nonce`].
463+ ///
464+ /// [`OffersContext::InboundPayment`]: crate::blinded_path::message::OffersContext::InboundPayment
459465 fn hmac_for_offer_payment(
460466 &self, nonce: Nonce, expanded_key: &inbound_payment::ExpandedKey,
461467 ) -> Hmac<Sha256> {
@@ -464,6 +470,8 @@ impl Verification for PaymentHash {
464470
465471 /// Authenticates the payment id using an HMAC and a [`Nonce`] taken from an
466472 /// [`OffersContext::InboundPayment`].
473+ ///
474+ /// [`OffersContext::InboundPayment`]: crate::blinded_path::message::OffersContext::InboundPayment
467475 fn verify_for_offer_payment(
468476 &self, hmac: Hmac<Sha256>, nonce: Nonce, expanded_key: &inbound_payment::ExpandedKey,
469477 ) -> Result<(), ()> {
@@ -518,6 +526,8 @@ impl PaymentId {
518526impl Verification for PaymentId {
519527 /// Constructs an HMAC to include in [`OffersContext::OutboundPayment`] for the payment id
520528 /// along with the given [`Nonce`].
529+ ///
530+ /// [`OffersContext::OutboundPayment`]: crate::blinded_path::message::OffersContext::OutboundPayment
521531 fn hmac_for_offer_payment(
522532 &self, nonce: Nonce, expanded_key: &inbound_payment::ExpandedKey,
523533 ) -> Hmac<Sha256> {
@@ -526,6 +536,8 @@ impl Verification for PaymentId {
526536
527537 /// Authenticates the payment id using an HMAC and a [`Nonce`] taken from an
528538 /// [`OffersContext::OutboundPayment`].
539+ ///
540+ /// [`OffersContext::OutboundPayment`]: crate::blinded_path::message::OffersContext::OutboundPayment
529541 fn verify_for_offer_payment(
530542 &self, hmac: Hmac<Sha256>, nonce: Nonce, expanded_key: &inbound_payment::ExpandedKey,
531543 ) -> Result<(), ()> {
@@ -2030,17 +2042,17 @@ where
20302042/// ```
20312043///
20322044/// ## BOLT 12 Offers
2033- ///
2045+ ///
20342046/// For more information on creating offers, see [`create_offer_builder`].
20352047///
20362048/// For details on initiating payments for offers, see [`pay_for_offer`].
20372049///
20382050/// ## BOLT 12 Refunds
2039- ///
2051+ ///
20402052/// For more information on creating refunds, see [`create_refund_builder`].
20412053///
20422054/// For requesting refund payments, see [`request_refund_payment`].
2043- ///
2055+ ///
20442056/// # Persistence
20452057///
20462058/// Implements [`Writeable`] to write out all channel state to disk. Implies [`peer_disconnected`] for
@@ -9572,27 +9584,11 @@ where
95729584 .collect::<Vec<_>>()
95739585 }
95749586
9575- fn verify_bolt12_invoice(
9576- &self, invoice: &Bolt12Invoice, context: Option<&OffersContext>,
9577- ) -> Result<PaymentId, ()> {
9578- let secp_ctx = &self.secp_ctx;
9579- let expanded_key = &self.inbound_payment_key;
9580-
9581- match context {
9582- None if invoice.is_for_refund_without_paths() => {
9583- invoice.verify_using_metadata(expanded_key, secp_ctx)
9584- },
9585- Some(&OffersContext::OutboundPayment { payment_id, nonce, .. }) => {
9586- invoice.verify_using_payer_data(payment_id, nonce, expanded_key, secp_ctx)
9587- },
9588- _ => Err(()),
9589- }
9590- }
9591-
95929587 fn send_payment_for_verified_bolt12_invoice(&self, invoice: &Bolt12Invoice, payment_id: PaymentId) -> Result<(), Bolt12PaymentError> {
95939588 let best_block_height = self.best_block.read().unwrap().height;
9594- let _persistence_guard = PersistenceNotifierGuard::notify_on_drop(self);
95959589 let features = self.bolt12_invoice_features();
9590+ let _persistence_guard = PersistenceNotifierGuard::notify_on_drop(self);
9591+
95969592 self.pending_outbound_payments
95979593 .send_payment_for_bolt12_invoice(
95989594 invoice, payment_id, &self.router, self.list_usable_channels(), features,
0 commit comments