Package org.ldk.structs
Class ChannelCounterparty
- java.lang.Object
-
- org.ldk.structs.ChannelCounterparty
-
public class ChannelCounterparty extends Object
Channel parameters which apply to our counterparty. These are split out from [`ChannelDetails`] to better separate parameters.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ChannelCounterparty
clone()
Creates a copy of the ChannelCounterpartyprotected void
finalize()
InitFeatures
get_features()
The Features the channel counterparty provided upon last connection.CounterpartyForwardingInfo
get_forwarding_info()
Information on the fees and requirements that the counterparty requires when forwarding payments to us through this channel.byte[]
get_node_id()
The node_id of our counterpartyOption_u64Z
get_outbound_htlc_maximum_msat()
The largest value HTLC (in msat) the remote peer currently will accept, for this channel.Option_u64Z
get_outbound_htlc_minimum_msat()
The smallest value HTLC (in msat) the remote peer will accept, for this channel.long
get_unspendable_punishment_reserve()
The value, in satoshis, that must always be held in the channel for our counterparty.static ChannelCounterparty
of(byte[] node_id_arg, InitFeatures features_arg, long unspendable_punishment_reserve_arg, CounterpartyForwardingInfo forwarding_info_arg, Option_u64Z outbound_htlc_minimum_msat_arg, Option_u64Z outbound_htlc_maximum_msat_arg)
Constructs a new ChannelCounterparty given each fieldstatic Result_ChannelCounterpartyDecodeErrorZ
read(byte[] ser)
Read a ChannelCounterparty from a byte array, created by ChannelCounterparty_writevoid
set_features(InitFeatures val)
The Features the channel counterparty provided upon last connection.void
set_forwarding_info(CounterpartyForwardingInfo val)
Information on the fees and requirements that the counterparty requires when forwarding payments to us through this channel.void
set_node_id(byte[] val)
The node_id of our counterpartyvoid
set_outbound_htlc_maximum_msat(Option_u64Z val)
The largest value HTLC (in msat) the remote peer currently will accept, for this channel.void
set_outbound_htlc_minimum_msat(Option_u64Z val)
The smallest value HTLC (in msat) the remote peer will accept, for this channel.void
set_unspendable_punishment_reserve(long val)
The value, in satoshis, that must always be held in the channel for our counterparty.byte[]
write()
Serialize the ChannelCounterparty object into a byte array which can be read by ChannelCounterparty_read
-
-
-
Method Detail
-
finalize
protected void finalize() throws Throwable
-
get_node_id
public byte[] get_node_id()
The node_id of our counterparty
-
set_node_id
public void set_node_id(byte[] val)
The node_id of our counterparty
-
get_features
public InitFeatures get_features()
The Features the channel counterparty provided upon last connection. Useful for routing as it is the most up-to-date copy of the counterparty's features and many routing-relevant features are present in the init context.
-
set_features
public void set_features(InitFeatures val)
The Features the channel counterparty provided upon last connection. Useful for routing as it is the most up-to-date copy of the counterparty's features and many routing-relevant features are present in the init context.
-
get_unspendable_punishment_reserve
public long get_unspendable_punishment_reserve()
The value, in satoshis, that must always be held in the channel for our counterparty. This value ensures that if our counterparty broadcasts a revoked state, we can punish them by claiming at least this value on chain. This value is not included in [`inbound_capacity_msat`] as it can never be spent. [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
-
set_unspendable_punishment_reserve
public void set_unspendable_punishment_reserve(long val)
The value, in satoshis, that must always be held in the channel for our counterparty. This value ensures that if our counterparty broadcasts a revoked state, we can punish them by claiming at least this value on chain. This value is not included in [`inbound_capacity_msat`] as it can never be spent. [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
-
get_forwarding_info
@Nullable public CounterpartyForwardingInfo get_forwarding_info()
Information on the fees and requirements that the counterparty requires when forwarding payments to us through this channel. Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
-
set_forwarding_info
public void set_forwarding_info(@Nullable CounterpartyForwardingInfo val)
Information on the fees and requirements that the counterparty requires when forwarding payments to us through this channel. Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
-
get_outbound_htlc_minimum_msat
public Option_u64Z get_outbound_htlc_minimum_msat()
The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
-
set_outbound_htlc_minimum_msat
public void set_outbound_htlc_minimum_msat(Option_u64Z val)
The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
-
get_outbound_htlc_maximum_msat
public Option_u64Z get_outbound_htlc_maximum_msat()
The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
-
set_outbound_htlc_maximum_msat
public void set_outbound_htlc_maximum_msat(Option_u64Z val)
The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
-
of
public static ChannelCounterparty of(byte[] node_id_arg, InitFeatures features_arg, long unspendable_punishment_reserve_arg, CounterpartyForwardingInfo forwarding_info_arg, Option_u64Z outbound_htlc_minimum_msat_arg, Option_u64Z outbound_htlc_maximum_msat_arg)
Constructs a new ChannelCounterparty given each field
-
clone
public ChannelCounterparty clone()
Creates a copy of the ChannelCounterparty
-
write
public byte[] write()
Serialize the ChannelCounterparty object into a byte array which can be read by ChannelCounterparty_read
-
read
public static Result_ChannelCounterpartyDecodeErrorZ read(byte[] ser)
Read a ChannelCounterparty from a byte array, created by ChannelCounterparty_write
-
-