1+ package org .ldk .enums ;
2+
3+ /**
4+ * Exposes the state of pending inbound HTLCs.
5+ *
6+ * At a high level, an HTLC being forwarded from one Lightning node to another Lightning node goes
7+ * through the following states in the state machine:
8+ * - Announced for addition by the originating node through the update_add_htlc message.
9+ * - Added to the commitment transaction of the receiving node and originating node in turn
10+ * through the exchange of commitment_signed and revoke_and_ack messages.
11+ * - Announced for resolution (fulfillment or failure) by the receiving node through either one of
12+ * the update_fulfill_htlc, update_fail_htlc, and update_fail_malformed_htlc messages.
13+ * - Removed from the commitment transaction of the originating node and receiving node in turn
14+ * through the exchange of commitment_signed and revoke_and_ack messages.
15+ *
16+ * This can be used to inspect what next message an HTLC is waiting for to advance its state.
17+ */
18+ public enum InboundHTLCStateDetails {
19+ /**
20+ * We have added this HTLC in our commitment transaction by receiving commitment_signed and
21+ * returning revoke_and_ack. We are awaiting the appropriate revoke_and_ack's from the remote
22+ * before this HTLC is included on the remote commitment transaction.
23+ */
24+ LDKInboundHTLCStateDetails_AwaitingRemoteRevokeToAdd ,
25+ /**
26+ * This HTLC has been included in the commitment_signed and revoke_and_ack messages on both sides
27+ * and is included in both commitment transactions.
28+ *
29+ * This HTLC is now safe to either forward or be claimed as a payment by us. The HTLC will
30+ * remain in this state until the forwarded upstream HTLC has been resolved and we resolve this
31+ * HTLC correspondingly, or until we claim it as a payment. If it is part of a multipart
32+ * payment, it will only be claimed together with other required parts.
33+ */
34+ LDKInboundHTLCStateDetails_Committed ,
35+ /**
36+ * We have received the preimage for this HTLC and it is being removed by fulfilling it with
37+ * update_fulfill_htlc. This HTLC is still on both commitment transactions, but we are awaiting
38+ * the appropriate revoke_and_ack's from the remote before this HTLC is removed from the remote
39+ * commitment transaction after update_fulfill_htlc.
40+ */
41+ LDKInboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveFulfill ,
42+ /**
43+ * The HTLC is being removed by failing it with update_fail_htlc or update_fail_malformed_htlc.
44+ * This HTLC is still on both commitment transactions, but we are awaiting the appropriate
45+ * revoke_and_ack's from the remote before this HTLC is removed from the remote commitment
46+ * transaction.
47+ */
48+ LDKInboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveFail ,
49+ ; static native void init ();
50+ static { org .ldk .impl .bindings .run_statics (); init (); }
51+ }
0 commit comments