Package org.ldk.structs
Class ChannelInfo
- java.lang.Object
-
- org.ldk.structs.ChannelInfo
-
public class ChannelInfo extends Object
Details about a channel (both directions). Received within a channel announcement.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ChannelInfo
clone()
Creates a copy of the ChannelInfoboolean
eq(ChannelInfo b)
Checks if two ChannelInfos contain equal inner contents.boolean
equals(Object o)
protected void
finalize()
ChannelAnnouncement
get_announcement_message()
An initial announcement of the channel Mostly redundant with the data we store in fields explicitly.Option_u64Z
get_capacity_sats()
The channel capacity as seen on-chain, if chain lookup is available.ChannelUpdateInfo
get_directional_info(byte channel_flags)
Returns a [`ChannelUpdateInfo`] based on the direction implied by the channel_flag.ChannelFeatures
get_features()
Protocol features of a channel communicated during its announcementNodeId
get_node_one()
Source node of the first direction of a channelNodeId
get_node_two()
Source node of the second direction of a channelChannelUpdateInfo
get_one_to_two()
Details about the first direction of a channel Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent NoneChannelUpdateInfo
get_two_to_one()
Details about the second direction of a channel Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent Nonestatic Result_ChannelInfoDecodeErrorZ
read(byte[] ser)
Read a ChannelInfo from a byte array, created by ChannelInfo_writevoid
set_announcement_message(ChannelAnnouncement val)
An initial announcement of the channel Mostly redundant with the data we store in fields explicitly.void
set_capacity_sats(Option_u64Z val)
The channel capacity as seen on-chain, if chain lookup is available.void
set_features(ChannelFeatures val)
Protocol features of a channel communicated during its announcementvoid
set_node_one(NodeId val)
Source node of the first direction of a channelvoid
set_node_two(NodeId val)
Source node of the second direction of a channelvoid
set_one_to_two(ChannelUpdateInfo val)
Details about the first direction of a channel Note that val (or a relevant inner pointer) may be NULL or all-0s to represent Nonevoid
set_two_to_one(ChannelUpdateInfo val)
Details about the second direction of a channel Note that val (or a relevant inner pointer) may be NULL or all-0s to represent Nonebyte[]
write()
Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
-
-
-
Method Detail
-
finalize
protected void finalize() throws Throwable
-
get_features
public ChannelFeatures get_features()
Protocol features of a channel communicated during its announcement
-
set_features
public void set_features(ChannelFeatures val)
Protocol features of a channel communicated during its announcement
-
get_node_one
public NodeId get_node_one()
Source node of the first direction of a channel
-
set_node_one
public void set_node_one(NodeId val)
Source node of the first direction of a channel
-
get_one_to_two
@Nullable public ChannelUpdateInfo get_one_to_two()
Details about the first direction of a channel Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
-
set_one_to_two
public void set_one_to_two(@Nullable ChannelUpdateInfo val)
Details about the first direction of a channel Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
-
get_node_two
public NodeId get_node_two()
Source node of the second direction of a channel
-
set_node_two
public void set_node_two(NodeId val)
Source node of the second direction of a channel
-
get_two_to_one
@Nullable public ChannelUpdateInfo get_two_to_one()
Details about the second direction of a channel Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
-
set_two_to_one
public void set_two_to_one(@Nullable ChannelUpdateInfo val)
Details about the second direction of a channel Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
-
get_capacity_sats
public Option_u64Z get_capacity_sats()
The channel capacity as seen on-chain, if chain lookup is available.
-
set_capacity_sats
public void set_capacity_sats(Option_u64Z val)
The channel capacity as seen on-chain, if chain lookup is available.
-
get_announcement_message
@Nullable public ChannelAnnouncement get_announcement_message()
An initial announcement of the channel Mostly redundant with the data we store in fields explicitly. Everything else is useful only for sending out for initial routing sync. Not stored if contains excess data to prevent DoS. Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
-
set_announcement_message
public void set_announcement_message(@Nullable ChannelAnnouncement val)
An initial announcement of the channel Mostly redundant with the data we store in fields explicitly. Everything else is useful only for sending out for initial routing sync. Not stored if contains excess data to prevent DoS. Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
-
clone
public ChannelInfo clone()
Creates a copy of the ChannelInfo
-
eq
public boolean eq(ChannelInfo b)
Checks if two ChannelInfos 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.
-
get_directional_info
@Nullable public ChannelUpdateInfo get_directional_info(byte channel_flags)
Returns a [`ChannelUpdateInfo`] based on the direction implied by the channel_flag. Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
-
write
public byte[] write()
Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
-
read
public static Result_ChannelInfoDecodeErrorZ read(byte[] ser)
Read a ChannelInfo from a byte array, created by ChannelInfo_write
-
-