#[repr(C, align(128))]pub struct ChannelInfo {
pub features: ChannelFeatures,
pub node_one: NodeId,
pub node_two: NodeId,
pub capacity_sats: Option<u64>,
pub one_to_two: Option<ChannelUpdateInfo>,
pub two_to_one: Option<ChannelUpdateInfo>,
pub announcement_message: Option<ChannelAnnouncement>,
/* private fields */
}Expand description
Details about a channel (both directions). Received within a channel announcement.
Fields§
§features: ChannelFeaturesProtocol features of a channel communicated during its announcement
node_one: NodeIdSource node of the first direction of a channel
node_two: NodeIdSource node of the second direction of a channel
capacity_sats: Option<u64>The channel capacity as seen on-chain, if chain lookup is available.
one_to_two: Option<ChannelUpdateInfo>Details about the first direction of a channel
two_to_one: Option<ChannelUpdateInfo>Details about the second direction of a channel
announcement_message: Option<ChannelAnnouncement>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.
Implementations§
Source§impl ChannelInfo
impl ChannelInfo
Sourcepub fn as_directed_to(
&self,
target: &NodeId,
) -> Option<(DirectedChannelInfo<'_>, &NodeId)>
pub fn as_directed_to( &self, target: &NodeId, ) -> Option<(DirectedChannelInfo<'_>, &NodeId)>
Returns a DirectedChannelInfo for the channel directed to the given target from a
returned source, or None if target is not one of the channel’s counterparties.
Sourcepub fn as_directed_from(
&self,
source: &NodeId,
) -> Option<(DirectedChannelInfo<'_>, &NodeId)>
pub fn as_directed_from( &self, source: &NodeId, ) -> Option<(DirectedChannelInfo<'_>, &NodeId)>
Returns a DirectedChannelInfo for the channel directed from the given source to a
returned target, or None if source is not one of the channel’s counterparties.
Sourcepub fn get_directional_info(
&self,
channel_flags: u8,
) -> Option<&ChannelUpdateInfo>
pub fn get_directional_info( &self, channel_flags: u8, ) -> Option<&ChannelUpdateInfo>
Returns a ChannelUpdateInfo based on the direction implied by the channel_flag.
Trait Implementations§
Source§impl Clone for ChannelInfo
impl Clone for ChannelInfo
Source§fn clone(&self) -> ChannelInfo
fn clone(&self) -> ChannelInfo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more