]> git.bitcoin.ninja Git - rust-lightning/commit
Add a `RecipientOnionFields` argument to spontaneous payment sends
authorMatt Corallo <git@bluematt.me>
Fri, 24 Mar 2023 01:19:20 +0000 (01:19 +0000)
committerMatt Corallo <git@bluematt.me>
Wed, 5 Apr 2023 16:28:14 +0000 (16:28 +0000)
commitbf87a59e91f83a407586867b43f93bf52d673e8e
tree903d5a52387bedf238fbddcd92d72f0330ab61bf
parentdddb2e28c1e2586346d94775d5bb63414c6a73bb
Add a `RecipientOnionFields` argument to spontaneous payment sends

While most lightning nodes don't (currently) support providing a
payment secret or payment metadata for spontaneous payments,
there's no specific technical reason why we shouldn't support
sending those fields to a recipient.

Further, when we eventually move to allowing custom TLV entries in
the recipient's onion TLV stream, we'll want to support it for
spontaneous payments as well.

Here we simply add the new `RecipientOnionFields` struct as an
argument to the spontaneous payment send methods. We don't yet
plumb it through the payment sending logic, which will come when we
plumb the new struct through the sending logic to replace the
existing payment secret arguments.
lightning/src/ln/channelmanager.rs
lightning/src/ln/functional_tests.rs
lightning/src/ln/outbound_payment.rs
lightning/src/ln/payment_tests.rs