Allow users to provide custom TLVs through `RecipientOnionFields`
authorAlec Chen <alecchendev@gmail.com>
Tue, 16 May 2023 22:56:28 +0000 (17:56 -0500)
committerAlec Chen <alecchendev@gmail.com>
Tue, 8 Aug 2023 20:55:00 +0000 (15:55 -0500)
commit039b1c8d1007cb7d42f594b0349cbbaf110a31a8
tree0abed8b65136f66306e9a38ee5aa6ba07df78939
parent4b241357387bcbb5cb51e00c83fab2dbeaebd0b3
Allow users to provide custom TLVs through `RecipientOnionFields`

Custom TLVs allow users to send extra application-specific data with
a payment. These have the additional flexibility compared to
`payment_metadata` that they don't have to reflect recipient generated
data provided in an invoice, in which `payment_metadata` could be
reused.

We ensure provided type numbers are unique, increasing, and within the
experimental range with the `RecipientOnionFields::with_custom_tlvs`
method.

This begins sender-side support for custom TLVs.
lightning-invoice/src/payment.rs
lightning/src/ln/channelmanager.rs
lightning/src/ln/outbound_payment.rs
lightning/src/ln/payment_tests.rs