Package org.ldk.structs
Class Event.PaymentClaimable
- java.lang.Object
-
- org.ldk.structs.Event
-
- org.ldk.structs.Event.PaymentClaimable
-
- Enclosing class:
- Event
public static final class Event.PaymentClaimable extends Event
Indicates that we've been offered a payment and it needs to be claimed via calling [`ChannelManager::claim_funds`] with the preimage given in [`PaymentPurpose`]. Note that if the preimage is not known, you should call [`ChannelManager::fail_htlc_backwards`] or [`ChannelManager::fail_htlc_backwards_with_reason`] to free up resources for this HTLC and avoid network congestion. If you fail to call either [`ChannelManager::claim_funds`], [`ChannelManager::fail_htlc_backwards`], or [`ChannelManager::fail_htlc_backwards_with_reason`] within the HTLC's timeout, the HTLC will be automatically failed. # Note LDK will not stop an inbound payment from being paid multiple times, so multiple `PaymentClaimable` events may be generated for the same payment. In such a case it is polite (and required in the lightning specification) to fail the payment the second time and give the sender their money back rather than accepting double payment. # Note This event used to be called `PaymentReceived` in LDK versions 0.0.112 and earlier. [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds [`ChannelManager::fail_htlc_backwards`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards [`ChannelManager::fail_htlc_backwards_with_reason`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards_with_reason
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.ldk.structs.Event
Event.ChannelClosed, Event.ChannelPending, Event.ChannelReady, Event.DiscardFunding, Event.FundingGenerationReady, Event.HTLCHandlingFailed, Event.HTLCIntercepted, Event.OpenChannelRequest, Event.PaymentClaimable, Event.PaymentClaimed, Event.PaymentFailed, Event.PaymentForwarded, Event.PaymentPathFailed, Event.PaymentPathSuccessful, Event.PaymentSent, Event.PendingHTLCsForwardable, Event.ProbeFailed, Event.ProbeSuccessful, Event.SpendableOutputs
-
-
Field Summary
Fields Modifier and Type Field Description long
amount_msat
The value, in thousandths of a satoshi, that this payment is for.Option_u32Z
claim_deadline
The block height at which this payment will be failed back and will no longer be eligible for claiming.RecipientOnionFields
onion_fields
The fields in the onion which were received with each HTLC.byte[]
payment_hash
The hash for which the preimage should be handed to the ChannelManager.PaymentPurpose
purpose
Information for claiming this received payment, based on whether the purpose of the payment is to pay an invoice or to send a spontaneous payment.byte[]
receiver_node_id
The node that will receive the payment after it has been claimed.byte[]
via_channel_id
The `channel_id` indicating over which channel we received the payment.Option_u128Z
via_user_channel_id
The `user_channel_id` indicating over which channel we received the payment.
-
Method Summary
-
Methods inherited from class org.ldk.structs.Event
channel_closed, channel_pending, channel_ready, clone, discard_funding, eq, equals, finalize, funding_generation_ready, htlchandling_failed, htlcintercepted, open_channel_request, payment_claimable, payment_claimed, payment_failed, payment_forwarded, payment_path_failed, payment_path_successful, payment_sent, pending_htlcs_forwardable, probe_failed, probe_successful, spendable_outputs, write
-
-
-
-
Field Detail
-
receiver_node_id
@Nullable public final byte[] receiver_node_id
The node that will receive the payment after it has been claimed. This is useful to identify payments received via [phantom nodes]. This field will always be filled in when the event was generated by LDK versions 0.0.113 and above. [phantom nodes]: crate::chain::keysinterface::PhantomKeysManager Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
-
payment_hash
public final byte[] payment_hash
The hash for which the preimage should be handed to the ChannelManager. Note that LDK will not stop you from registering duplicate payment hashes for inbound payments.
-
onion_fields
@Nullable public final RecipientOnionFields onion_fields
The fields in the onion which were received with each HTLC. Only fields which were identical in each HTLC involved in the payment will be included here. Payments received on LDK versions prior to 0.0.115 will have this field unset. Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
-
amount_msat
public final long amount_msat
The value, in thousandths of a satoshi, that this payment is for.
-
purpose
public final PaymentPurpose purpose
Information for claiming this received payment, based on whether the purpose of the payment is to pay an invoice or to send a spontaneous payment.
-
via_channel_id
@Nullable public final byte[] via_channel_id
The `channel_id` indicating over which channel we received the payment. Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
-
via_user_channel_id
public final Option_u128Z via_user_channel_id
The `user_channel_id` indicating over which channel we received the payment.
-
claim_deadline
public final Option_u32Z claim_deadline
The block height at which this payment will be failed back and will no longer be eligible for claiming. Prior to this height, a call to [`ChannelManager::claim_funds`] is guaranteed to succeed, however you should wait for [`Event::PaymentClaimed`] to be sure. [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
-
-