+ Committed,
+ /// Removed by us and a new commitment_signed was sent (if we were AwaitingRemoteRevoke when we
+ /// created it we would have put it in the holding cell instead). When they next revoke_and_ack
+ /// we'll drop it.
+ /// Note that we have to keep an eye on the HTLC until we've received a broadcastable
+ /// commitment transaction without it as otherwise we'll have to force-close the channel to
+ /// claim it before the timeout (obviously doesn't apply to revoked HTLCs that we can't claim
+ /// anyway). That said, ChannelMonitor does this for us (see
+ /// ChannelMonitor::would_broadcast_at_height) so we actually remove the HTLC from our own
+ /// local state before then, once we're sure that the next commitment_signed and
+ /// ChannelMonitor::provide_latest_local_commitment_tx_info will not include this HTLC.
+ LocalRemoved,
+}
+
+struct InboundHTLCOutput {
+ htlc_id: u64,
+ amount_msat: u64,
+ cltv_expiry: u32,
+ payment_hash: [u8; 32],
+ state: InboundHTLCState,
+ /// If we're in LocalRemoved, set to true if we fulfilled the HTLC, and can claim money
+ local_removed_fulfilled: bool,
+ /// state pre-Committed implies pending_forward_state, otherwise it must be None
+ pending_forward_state: Option<PendingHTLCStatus>,
+}
+
+#[derive(PartialEq)]
+enum OutboundHTLCState {