Skip to content

Commit f924fc1

Browse files
committed
f payment document types
1 parent f4b7ac7 commit f924fc1

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

lightning/src/blinded_path/payment.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,10 @@ pub enum PaymentContext {
576576
}
577577
impl PaymentContext {
578578
/// Returns the additional payment metadata stored alongside this payment context, if any.
579+
///
580+
/// Payment metadata is stored as a map from a numeric key to an arbitrary byte array value.
581+
/// This allows for several types of metadata to be stored attached to a single payment. In the
582+
/// future some optional features of LDK may use some keys.
579583
pub fn payment_metadata(&self) -> Option<&BTreeMap<u64, Vec<u8>>> {
580584
match self {
581585
Self::Bolt12Offer(Bolt12OfferContext { payment_metadata, .. })
@@ -615,6 +619,10 @@ pub struct Bolt12OfferContext {
615619
/// needs to be "stored" by a payment recipient for their own internal use, provided back to
616620
/// them with the payment.
617621
///
622+
/// Payment metadata is stored as a map from a numeric key to an arbitrary byte array value.
623+
/// This allows for several types of metadata to be stored attached to a single payment. In the
624+
/// future some optional features of LDK may use some keys.
625+
///
618626
/// Note that because this is included in the payment onion, its size must be tightly
619627
/// constrained. More than a few hundred bytes and the payment will be entirely unpayable (with
620628
/// limited routing options as size increases).
@@ -643,6 +651,10 @@ pub struct AsyncBolt12OfferContext {
643651
/// needs to be "stored" by a payment recipient for their own internal use, provided back to
644652
/// them with the payment.
645653
///
654+
/// Payment metadata is stored as a map from a numeric key to an arbitrary byte array value.
655+
/// This allows for several types of metadata to be stored attached to a single payment. In the
656+
/// future some optional features of LDK may use some keys.
657+
///
646658
/// Note that because this is included in the payment onion, its size must be tightly
647659
/// constrained. More than a few hundred bytes and the payment will be entirely unpayable (with
648660
/// limited routing options as size increases).
@@ -665,6 +677,10 @@ pub struct Bolt12RefundContext {
665677
/// needs to be "stored" by a payment recipient for their own internal use, provided back to
666678
/// them with the payment.
667679
///
680+
/// Payment metadata is stored as a map from a numeric key to an arbitrary byte array value.
681+
/// This allows for several types of metadata to be stored attached to a single payment. In the
682+
/// future some optional features of LDK may use some keys.
683+
///
668684
/// Note that because this is included in the payment onion, its size must be tightly
669685
/// constrained. More than a few hundred bytes and the payment will be entirely unpayable (with
670686
/// limited routing options as size increases).

0 commit comments

Comments
 (0)