pub enum PaymentPurpose {
InvoicePayment {
payment_preimage: Option<PaymentPreimage>,
payment_secret: PaymentSecret,
},
SpontaneousPayment(PaymentPreimage),
}
Expand description
Some information provided on receipt of payment depends on whether the payment received is a spontaneous payment or a “conventional” lightning payment that’s paying an invoice.
Variants
InvoicePayment
Fields
payment_preimage: Option<PaymentPreimage>
The preimage to the payment_hash, if the payment hash (and secret) were fetched via
ChannelManager::create_inbound_payment
. If provided, this can be handed directly to
ChannelManager::claim_funds
.
payment_secret: PaymentSecret
The “payment secret”. This authenticates the sender to the recipient, preventing a
number of deanonymization attacks during the routing process.
It is provided here for your reference, however its accuracy is enforced directly by
ChannelManager
using the values you previously provided to
ChannelManager::create_inbound_payment
or
ChannelManager::create_inbound_payment_for_hash
.
Information for receiving a payment that we generated an invoice for.
SpontaneousPayment(PaymentPreimage)
Because this is a spontaneous payment, the payer generated their own preimage rather than us (the payee) providing a preimage.
Trait Implementations
sourceimpl Clone for PaymentPurpose
impl Clone for PaymentPurpose
sourcefn clone(&self) -> PaymentPurpose
fn clone(&self) -> PaymentPurpose
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for PaymentPurpose
impl Debug for PaymentPurpose
sourceimpl Readable for PaymentPurpose
impl Readable for PaymentPurpose
sourceimpl Writeable for PaymentPurpose
impl Writeable for PaymentPurpose
sourcefn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>
fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>
Writes self out to the given Writer
sourcefn encode(&self) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
fn encode(&self) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Writes self out to a Vec
sourcefn serialized_length(&self) -> usize
fn serialized_length(&self) -> usize
Gets the length of this object after it has been serialized. This can be overridden to optimize cases where we prepend an object with its length. Read more
Auto Trait Implementations
impl RefUnwindSafe for PaymentPurpose
impl Send for PaymentPurpose
impl Sync for PaymentPurpose
impl Unpin for PaymentPurpose
impl UnwindSafe for PaymentPurpose
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more