@@ -77,7 +77,7 @@ use core::time::Duration;
77
77
use core:: ops:: Deref ;
78
78
79
79
// Re-export this for use in the public API.
80
- pub use crate :: ln:: outbound_payment:: { PaymentSendFailure , Retry , RetryableSendFailure } ;
80
+ pub use crate :: ln:: outbound_payment:: { PaymentSendFailure , Retry , RetryableSendFailure , RecipientOnionFields } ;
81
81
82
82
// We hold various information about HTLC relay in the HTLC objects in Channel itself:
83
83
//
@@ -226,38 +226,6 @@ impl Readable for PaymentId {
226
226
}
227
227
}
228
228
229
- /// Information which is provided, encrypted, to the payment recipient when sending HTLCs.
230
- ///
231
- /// This should generally be constructed with data communicated to us from the recipient (via some
232
- /// form of invoice).
233
- #[ derive( Clone ) ]
234
- pub struct RecipientOnionFields {
235
- /// The [`PaymentSecret`] which is an arbitrary 32 bytes provided by the recipient for us to
236
- /// repeat in the onion. It is unrelated to `payment_hash` (or [`PaymentPreimage`]) and exists
237
- /// to authenticate the sender to the recipient and prevent payment-probing (deanonymization)
238
- /// attacks.
239
- ///
240
- /// If you do not have one, the [`Route`] you pay over must not contain multiple paths as
241
- /// multi-path payments require a recipient-provided secret.
242
- pub payment_secret : Option < PaymentSecret > ,
243
- }
244
-
245
- impl RecipientOnionFields {
246
- /// Creates a [`RecipientOnionFields`] from only a [`PaymentSecret`]. This is the most common
247
- /// set of onion fields for today's BOLT11 invoices - most nodes require a [`PaymentSecret`]
248
- /// but do not require or provide any further data.
249
- pub fn secret_only ( payment_secret : PaymentSecret ) -> Self {
250
- Self { payment_secret : Some ( payment_secret) }
251
- }
252
-
253
- /// Creates a new [`RecipientOnionFields`] with no fields. This generally does not create
254
- /// payable HTLCs except for spontaneous payments, i.e. this should generally only be used for
255
- /// calls to [`ChannelManager::send_spontaneous_payment`].
256
- pub fn spontaneous_empty ( ) -> Self {
257
- Self { payment_secret : None }
258
- }
259
- }
260
-
261
229
/// An identifier used to uniquely identify an intercepted HTLC to LDK.
262
230
///
263
231
/// This is not exported to bindings users as we just use [u8; 32] directly
0 commit comments