@@ -175,28 +175,11 @@ enum InboundHTLCState {
175
175
pub enum InboundHTLCStateDetails {
176
176
/// The remote node announced the HTLC with update_add_htlc but the HTLC is not added to any
177
177
/// commitment transactions yet.
178
- ///
179
- /// We intend to forward the HTLC as it is correctly formed and is forwardable to the next hop.
180
- RemoteAnnouncedForward,
181
- /// The remote node announced the HTLC with update_add_htlc but the HTLC is not added to any
182
- /// commitment transactions yet.
183
- ///
184
- /// We intend to fail the HTLC as it is malformed or we are unable to forward to the next hop,
185
- /// for example if the peer is disconnected or not enough capacity is available.
186
- RemoteAnnouncedFail,
187
- /// We have added this HTLC in our commitment transaction by receiving commitment_signed and
188
- /// returning revoke_and_ack. We are awaiting the appropriate revoke_and_ack's from the remote
189
- /// before this HTLC is included on the remote commitment transaction.
190
- ///
191
- /// We intend to forward the HTLC as it is correctly formed and is forwardable to the next hop.
192
- AwaitingRemoteRevokeToAddForward,
178
+ RemoteAnnounced,
193
179
/// We have added this HTLC in our commitment transaction by receiving commitment_signed and
194
180
/// returning revoke_and_ack. We are awaiting the appropriate revoke_and_ack's from the remote
195
181
/// before this HTLC is included on the remote commitment transaction.
196
- ///
197
- /// We intend to fail the HTLC as it is malformed or we are unable to forward to the next hop,
198
- /// for example if the peer is disconnected or not enough capacity is available.
199
- AwaitingRemoteRevokeToAddFail,
182
+ AwaitingRemoteRevokeToAdd,
200
183
/// This HTLC has been included in the commitment_signed and revoke_and_ack messages on both sides
201
184
/// and is included in both commitment transactions.
202
185
///
@@ -220,18 +203,12 @@ pub enum InboundHTLCStateDetails {
220
203
impl From<&InboundHTLCState> for InboundHTLCStateDetails {
221
204
fn from(state: &InboundHTLCState) -> InboundHTLCStateDetails {
222
205
match state {
223
- InboundHTLCState::RemoteAnnounced(PendingHTLCStatus::Forward(_)) =>
224
- InboundHTLCStateDetails::RemoteAnnouncedForward,
225
- InboundHTLCState::RemoteAnnounced(PendingHTLCStatus::Fail(_)) =>
226
- InboundHTLCStateDetails::RemoteAnnouncedFail,
227
- InboundHTLCState::AwaitingRemoteRevokeToAnnounce(PendingHTLCStatus::Forward(_)) =>
228
- InboundHTLCStateDetails::AwaitingRemoteRevokeToAddForward,
229
- InboundHTLCState::AwaitingRemoteRevokeToAnnounce(PendingHTLCStatus::Fail(_)) =>
230
- InboundHTLCStateDetails::AwaitingRemoteRevokeToAddFail,
231
- InboundHTLCState::AwaitingAnnouncedRemoteRevoke(PendingHTLCStatus::Forward(_)) =>
232
- InboundHTLCStateDetails::AwaitingRemoteRevokeToAddForward,
233
- InboundHTLCState::AwaitingAnnouncedRemoteRevoke(PendingHTLCStatus::Fail(_)) =>
234
- InboundHTLCStateDetails::AwaitingRemoteRevokeToAddFail,
206
+ InboundHTLCState::RemoteAnnounced(_) =>
207
+ InboundHTLCStateDetails::RemoteAnnounced,
208
+ InboundHTLCState::AwaitingRemoteRevokeToAnnounce(_) =>
209
+ InboundHTLCStateDetails::AwaitingRemoteRevokeToAdd,
210
+ InboundHTLCState::AwaitingAnnouncedRemoteRevoke(_) =>
211
+ InboundHTLCStateDetails::AwaitingRemoteRevokeToAdd,
235
212
InboundHTLCState::Committed =>
236
213
InboundHTLCStateDetails::Committed,
237
214
InboundHTLCState::LocalRemoved(InboundHTLCRemovalReason::FailRelay(_)) =>
@@ -245,13 +222,11 @@ impl From<&InboundHTLCState> for InboundHTLCStateDetails {
245
222
}
246
223
247
224
impl_writeable_tlv_based_enum!(InboundHTLCStateDetails,
248
- (0, RemoteAnnouncedForward) => {},
249
- (2, RemoteAnnouncedFail) => {},
250
- (4, AwaitingRemoteRevokeToAddForward) => {},
251
- (6, AwaitingRemoteRevokeToAddFail) => {},
252
- (8, Committed) => {},
253
- (10, AwaitingRemoteRevokeToRemoveFulfill) => {},
254
- (12, AwaitingRemoteRevokeToRemoveFail) => {};
225
+ (0, RemoteAnnounced) => {},
226
+ (2, AwaitingRemoteRevokeToAdd) => {},
227
+ (4, Committed) => {},
228
+ (6, AwaitingRemoteRevokeToRemoveFulfill) => {},
229
+ (8, AwaitingRemoteRevokeToRemoveFail) => {};
255
230
);
256
231
257
232
struct InboundHTLCOutput {
0 commit comments