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