Package org.ldk.structs
Class UnsignedChannelUpdate
- java.lang.Object
-
- org.ldk.structs.UnsignedChannelUpdate
-
public class UnsignedChannelUpdate extends Object
The unsigned part of a [`channel_update`] message. [`channel_update`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description UnsignedChannelUpdate
clone()
Creates a copy of the UnsignedChannelUpdateboolean
eq(UnsignedChannelUpdate b)
Checks if two UnsignedChannelUpdates contain equal inner contents.boolean
equals(Object o)
protected void
finalize()
byte[]
get_chain_hash()
The genesis hash of the blockchain where the channel is to be openedshort
get_cltv_expiry_delta()
The number of blocks such that if: `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta` then we need to fail the HTLC backwards.byte[]
get_excess_data()
Excess data which was signed as a part of the message which we do not (yet) understand how to decode.int
get_fee_base_msat()
The base HTLC fee charged by sender, in milli-satoshiint
get_fee_proportional_millionths()
The amount to fee multiplier, in micro-satoshibyte
get_flags()
Channel flagslong
get_htlc_maximum_msat()
The maximum HTLC value incoming to sender, in milli-satoshi.long
get_htlc_minimum_msat()
The minimum HTLC size incoming to sender, in milli-satoshilong
get_short_channel_id()
The short channel IDint
get_timestamp()
A strictly monotonic announcement counter, with gaps allowed, specific to this channelstatic UnsignedChannelUpdate
of(byte[] chain_hash_arg, long short_channel_id_arg, int timestamp_arg, byte flags_arg, short cltv_expiry_delta_arg, long htlc_minimum_msat_arg, long htlc_maximum_msat_arg, int fee_base_msat_arg, int fee_proportional_millionths_arg, byte[] excess_data_arg)
Constructs a new UnsignedChannelUpdate given each fieldstatic Result_UnsignedChannelUpdateDecodeErrorZ
read(byte[] ser)
Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_writevoid
set_chain_hash(byte[] val)
The genesis hash of the blockchain where the channel is to be openedvoid
set_cltv_expiry_delta(short val)
The number of blocks such that if: `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta` then we need to fail the HTLC backwards.void
set_excess_data(byte[] val)
Excess data which was signed as a part of the message which we do not (yet) understand how to decode.void
set_fee_base_msat(int val)
The base HTLC fee charged by sender, in milli-satoshivoid
set_fee_proportional_millionths(int val)
The amount to fee multiplier, in micro-satoshivoid
set_flags(byte val)
Channel flagsvoid
set_htlc_maximum_msat(long val)
The maximum HTLC value incoming to sender, in milli-satoshi.void
set_htlc_minimum_msat(long val)
The minimum HTLC size incoming to sender, in milli-satoshivoid
set_short_channel_id(long val)
The short channel IDvoid
set_timestamp(int val)
A strictly monotonic announcement counter, with gaps allowed, specific to this channelbyte[]
write()
Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
-
-
-
Method Detail
-
finalize
protected void finalize() throws Throwable
-
get_chain_hash
public byte[] get_chain_hash()
The genesis hash of the blockchain where the channel is to be opened
-
set_chain_hash
public void set_chain_hash(byte[] val)
The genesis hash of the blockchain where the channel is to be opened
-
get_short_channel_id
public long get_short_channel_id()
The short channel ID
-
set_short_channel_id
public void set_short_channel_id(long val)
The short channel ID
-
get_timestamp
public int get_timestamp()
A strictly monotonic announcement counter, with gaps allowed, specific to this channel
-
set_timestamp
public void set_timestamp(int val)
A strictly monotonic announcement counter, with gaps allowed, specific to this channel
-
get_flags
public byte get_flags()
Channel flags
-
set_flags
public void set_flags(byte val)
Channel flags
-
get_cltv_expiry_delta
public short get_cltv_expiry_delta()
The number of blocks such that if: `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta` then we need to fail the HTLC backwards. When forwarding an HTLC, `cltv_expiry_delta` determines the outgoing HTLC's minimum `cltv_expiry` value -- so, if an incoming HTLC comes in with a `cltv_expiry` of 100000, and the node we're forwarding to has a `cltv_expiry_delta` value of 10, then we'll check that the outgoing HTLC's `cltv_expiry` value is at least 100010 before forwarding. Note that the HTLC sender is the one who originally sets this value when constructing the route.
-
set_cltv_expiry_delta
public void set_cltv_expiry_delta(short val)
The number of blocks such that if: `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta` then we need to fail the HTLC backwards. When forwarding an HTLC, `cltv_expiry_delta` determines the outgoing HTLC's minimum `cltv_expiry` value -- so, if an incoming HTLC comes in with a `cltv_expiry` of 100000, and the node we're forwarding to has a `cltv_expiry_delta` value of 10, then we'll check that the outgoing HTLC's `cltv_expiry` value is at least 100010 before forwarding. Note that the HTLC sender is the one who originally sets this value when constructing the route.
-
get_htlc_minimum_msat
public long get_htlc_minimum_msat()
The minimum HTLC size incoming to sender, in milli-satoshi
-
set_htlc_minimum_msat
public void set_htlc_minimum_msat(long val)
The minimum HTLC size incoming to sender, in milli-satoshi
-
get_htlc_maximum_msat
public long get_htlc_maximum_msat()
The maximum HTLC value incoming to sender, in milli-satoshi. This used to be optional.
-
set_htlc_maximum_msat
public void set_htlc_maximum_msat(long val)
The maximum HTLC value incoming to sender, in milli-satoshi. This used to be optional.
-
get_fee_base_msat
public int get_fee_base_msat()
The base HTLC fee charged by sender, in milli-satoshi
-
set_fee_base_msat
public void set_fee_base_msat(int val)
The base HTLC fee charged by sender, in milli-satoshi
-
get_fee_proportional_millionths
public int get_fee_proportional_millionths()
The amount to fee multiplier, in micro-satoshi
-
set_fee_proportional_millionths
public void set_fee_proportional_millionths(int val)
The amount to fee multiplier, in micro-satoshi
-
get_excess_data
public byte[] get_excess_data()
Excess data which was signed as a part of the message which we do not (yet) understand how to decode. This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol. Returns a copy of the field.
-
set_excess_data
public void set_excess_data(byte[] val)
Excess data which was signed as a part of the message which we do not (yet) understand how to decode. This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
-
of
public static UnsignedChannelUpdate of(byte[] chain_hash_arg, long short_channel_id_arg, int timestamp_arg, byte flags_arg, short cltv_expiry_delta_arg, long htlc_minimum_msat_arg, long htlc_maximum_msat_arg, int fee_base_msat_arg, int fee_proportional_millionths_arg, byte[] excess_data_arg)
Constructs a new UnsignedChannelUpdate given each field
-
clone
public UnsignedChannelUpdate clone()
Creates a copy of the UnsignedChannelUpdate
-
eq
public boolean eq(UnsignedChannelUpdate b)
Checks if two UnsignedChannelUpdates 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 UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
-
read
public static Result_UnsignedChannelUpdateDecodeErrorZ read(byte[] ser)
Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
-
-