Class ClaimedHTLC


  • public class ClaimedHTLC
    extends Object
    Information about an HTLC that is part of a payment that can be claimed.
    • Method Detail

      • get_channel_id

        public byte[] get_channel_id()
        The `channel_id` of the channel over which the HTLC was received.
      • set_channel_id

        public void set_channel_id​(byte[] val)
        The `channel_id` of the channel over which the HTLC was received.
      • get_user_channel_id

        public UInt128 get_user_channel_id()
        The `user_channel_id` of the channel over which the HTLC was received. This is the value passed in to [`ChannelManager::create_channel`] for outbound channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise `user_channel_id` will be randomized for an inbound channel. This field will be zero for a payment that was serialized prior to LDK version 0.0.117. (This should only happen in the case that a payment was claimable prior to LDK version 0.0.117, but was not actually claimed until after upgrading.) [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
      • set_user_channel_id

        public void set_user_channel_id​(UInt128 val)
        The `user_channel_id` of the channel over which the HTLC was received. This is the value passed in to [`ChannelManager::create_channel`] for outbound channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise `user_channel_id` will be randomized for an inbound channel. This field will be zero for a payment that was serialized prior to LDK version 0.0.117. (This should only happen in the case that a payment was claimable prior to LDK version 0.0.117, but was not actually claimed until after upgrading.) [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
      • get_cltv_expiry

        public int get_cltv_expiry()
        The block height at which this HTLC expires.
      • set_cltv_expiry

        public void set_cltv_expiry​(int val)
        The block height at which this HTLC expires.
      • get_value_msat

        public long get_value_msat()
        The amount (in msats) of this part of an MPP.
      • set_value_msat

        public void set_value_msat​(long val)
        The amount (in msats) of this part of an MPP.
      • of

        public static ClaimedHTLC of​(byte[] channel_id_arg,
                                     UInt128 user_channel_id_arg,
                                     int cltv_expiry_arg,
                                     long value_msat_arg)
        Constructs a new ClaimedHTLC given each field
      • eq

        public boolean eq​(ClaimedHTLC b)
        Checks if two ClaimedHTLCs contain equal inner contents. This ignores pointers and is_owned flags and looks at the values in fields. Two objects with NULL inner values will be considered "equal" here.
      • write

        public byte[] write()
        Serialize the ClaimedHTLC object into a byte array which can be read by ClaimedHTLC_read