Package org.ldk.structs
Class ClaimedHTLC
- java.lang.Object
-
- org.ldk.structs.ClaimedHTLC
-
public class ClaimedHTLC extends Object
Information about an HTLC that is part of a payment that can be claimed.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ClaimedHTLCclone()Creates a copy of the ClaimedHTLCbooleaneq(ClaimedHTLC b)Checks if two ClaimedHTLCs contain equal inner contents.booleanequals(Object o)protected voidfinalize()byte[]get_channel_id()The `channel_id` of the channel over which the HTLC was received.intget_cltv_expiry()The block height at which this HTLC expires.UInt128get_user_channel_id()The `user_channel_id` of the channel over which the HTLC was received.longget_value_msat()The amount (in msats) of this part of an MPP.static ClaimedHTLCof(byte[] channel_id_arg, UInt128 user_channel_id_arg, int cltv_expiry_arg, long value_msat_arg)Constructs a new ClaimedHTLC given each fieldstatic Result_ClaimedHTLCDecodeErrorZread(byte[] ser)Read a ClaimedHTLC from a byte array, created by ClaimedHTLC_writevoidset_channel_id(byte[] val)The `channel_id` of the channel over which the HTLC was received.voidset_cltv_expiry(int val)The block height at which this HTLC expires.voidset_user_channel_id(UInt128 val)The `user_channel_id` of the channel over which the HTLC was received.voidset_value_msat(long val)The amount (in msats) of this part of an MPP.byte[]write()Serialize the ClaimedHTLC object into a byte array which can be read by ClaimedHTLC_read
-
-
-
Method Detail
-
finalize
protected void finalize() throws Throwable
-
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
-
clone
public ClaimedHTLC clone()
Creates a copy of the ClaimedHTLC
-
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
-
read
public static Result_ClaimedHTLCDecodeErrorZ read(byte[] ser)
Read a ClaimedHTLC from a byte array, created by ClaimedHTLC_write
-
-