Pipe received `payment_metadata` through the HTLC receipt pipeline
authorMatt Corallo <git@bluematt.me>
Fri, 7 Apr 2023 20:43:54 +0000 (20:43 +0000)
committerMatt Corallo <git@bluematt.me>
Wed, 19 Apr 2023 14:55:42 +0000 (14:55 +0000)
commit9c55adaa4a15a2eb9eedc65831cdb74ae33e8a94
tree35672c8a8831b4ee2b94c785d211b1d804475e54
parent3dd05ab2619f91f94db4b0de09453019a4064d32
Pipe received `payment_metadata` through the HTLC receipt pipeline

When we receive an HTLC, we want to pass the `payment_metadata`
through to the `PaymentClaimable` event. This does most of the
internal refactoring required to do so - storing a
`RecipientOnionFields` in the inbound HTLC tracking structs,
including the `payment_metadata`.

In the future this struct will allow us to do MPP keysend receipts
(as it now stores an Optional `payment_secret` for all inbound
payments) as well as custom TLV receipts (as the struct is
extensible to store additional fields and the internal API supports
filtering for fields which are consistent across HTLCs).
lightning/src/ln/channelmanager.rs
lightning/src/ln/outbound_payment.rs