@@ -54,15 +54,20 @@ enum InboundHTLCRemovalReason {
54
54
55
55
enum InboundHTLCState {
56
56
/// Offered by remote, to be included in next local commitment tx. I.e., the remote sent an
57
- // update_add_htlc message for this HTLC.
57
+ /// update_add_htlc message for this HTLC.
58
58
RemoteAnnounced ( PendingHTLCStatus ) ,
59
- /// Included in a received commitment_signed message (implying we've revoke_and_ack'd it), but
60
- /// the remote hasn't yet revoked their previous state (see the example below). We have not yet
61
- /// included this HTLC in a commitment_signed message because we are waiting on the remote's
62
- /// aforementioned state revocation. The reason we need this remote RAA (revoke_and_ack) is
63
- /// because every time we create a new "state", i.e. every time we create our next
64
- /// per_commitment_point (see [BOLT #2]), we consume a prior revocation point (aka the
65
- /// per_commitment_secret in the revoke_and_ack message (see BOLT #2)).
59
+ /// Included in a received commitment_signed message (implying we've
60
+ /// revoke_and_ack'd it), but the remote hasn't yet revoked their previous
61
+ /// state (see the example below). We have not yet included this HTLC in a
62
+ /// commitment_signed message because we are waiting on the remote's
63
+ /// aforementioned state revocation. One reason this missing remote RAA
64
+ /// (revoke_and_ack) blocks us from constructing a commitment_signed message
65
+ /// is because every time we create a new "state", i.e. every time we sign a
66
+ /// new commitment tx (see [BOLT #2]), we need a new per_commitment_point,
67
+ /// which are provided one-at-a-time in each RAA. E.g., the last RAA they
68
+ /// sent provided the per_commitment_point for our current commitment tx.
69
+ /// The other reason we should not send a commitment_signed without their RAA
70
+ /// is because their RAA serves to ACK our previous commitment_signed.
66
71
///
67
72
/// Here's an example of how an HTLC could come to be in this state:
68
73
/// remote --> update_add_htlc(prev_htlc) --> local
@@ -72,10 +77,11 @@ enum InboundHTLCState {
72
77
/// [note that here, the remote does not respond with a RAA]
73
78
/// remote --> update_add_htlc(this_htlc) --> local
74
79
/// remote --> commitment_signed(prev_htlc, this_htlc) --> local
75
- /// Now `this_htlc` will be assigned this state. It's unable to be officially accepted, i.e.
76
- /// included in a commitment_signed, because we're missing the RAA that would let us construct
77
- /// our next per_commitment_point, which is used to derive commitment keys, which are used
78
- /// to construct the signatures in a commitment_signed message.
80
+ /// Now `this_htlc` will be assigned this state. It's unable to be officially
81
+ /// accepted, i.e. included in a commitment_signed, because we're missing the
82
+ /// RAA that provides our next per_commitment_point. The per_commitment_point
83
+ /// is used to derive commitment keys, which are used to construct the
84
+ /// signatures in a commitment_signed message.
79
85
/// Implies AwaitingRemoteRevoke.
80
86
/// [BOLT #2]: https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md
81
87
AwaitingRemoteRevokeToAnnounce ( PendingHTLCStatus ) ,
0 commit comments