Struct lightning::ln::channelmanager::ChannelDetails
source · [−]pub struct ChannelDetails {Show 16 fields
pub channel_id: [u8; 32],
pub counterparty: ChannelCounterparty,
pub funding_txo: Option<OutPoint>,
pub short_channel_id: Option<u64>,
pub channel_value_satoshis: u64,
pub unspendable_punishment_reserve: Option<u64>,
pub user_channel_id: u64,
pub balance_msat: u64,
pub outbound_capacity_msat: u64,
pub inbound_capacity_msat: u64,
pub confirmations_required: Option<u32>,
pub force_close_spend_delay: Option<u16>,
pub is_outbound: bool,
pub is_funding_locked: bool,
pub is_usable: bool,
pub is_public: bool,
}
Expand description
Details of a channel, as returned by ChannelManager::list_channels and ChannelManager::list_usable_channels
Fields
channel_id: [u8; 32]
The channel’s ID (prior to funding transaction generation, this is a random 32 bytes, thereafter this is the txid of the funding transaction xor the funding transaction output). Note that this means this value is not persistent - it can change once during the lifetime of the channel.
counterparty: ChannelCounterparty
Parameters which apply to our counterparty. See individual fields for more information.
funding_txo: Option<OutPoint>
The Channel’s funding transaction output, if we’ve negotiated the funding transaction with our counterparty already.
Note that, if this has been set, channel_id
will be equivalent to
funding_txo.unwrap().to_channel_id()
.
short_channel_id: Option<u64>
The position of the funding transaction in the chain. None if the funding transaction has not yet been confirmed and the channel fully opened.
channel_value_satoshis: u64
The value, in satoshis, of this channel as appears in the funding output
unspendable_punishment_reserve: Option<u64>
The value, in satoshis, that must always be held in the channel for us. This value ensures that if we broadcast a revoked state, our counterparty can punish us by claiming at least this value on chain.
This value is not included in outbound_capacity_msat
as it can never be spent.
This value will be None
for outbound channels until the counterparty accepts the channel.
user_channel_id: u64
The user_channel_id
passed in to create_channel, or 0 if the channel was inbound.
balance_msat: u64
Our total balance. This is the amount we would get if we close the channel. This value is not exact. Due to various in-flight changes and feerate changes, exactly this amount is not likely to be recoverable on close.
This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not available for inclusion in new outbound HTLCs). This further does not include any pending outgoing HTLCs which are awaiting some other resolution to be sent. This does not consider any on-chain fees.
outbound_capacity_msat: u64
The available outbound capacity for sending HTLCs to the remote peer. This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not available for inclusion in new outbound HTLCs). This further does not include any pending outgoing HTLCs which are awaiting some other resolution to be sent.
See also ChannelDetails::balance_msat
This value is not exact. Due to various in-flight changes, feerate changes, and our conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we should be able to spend nearly this amount.
inbound_capacity_msat: u64
The available inbound capacity for the remote peer to send HTLCs to us. This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not available for inclusion in new inbound HTLCs). Note that there are some corner cases not fully handled here, so the actual available inbound capacity may be slightly higher than this.
This value is not exact. Due to various in-flight changes, feerate changes, and our counterparty’s conflict-avoidance policy, exactly this amount is not likely to be spendable. However, our counterparty should be able to spend nearly this amount.
confirmations_required: Option<u32>
The number of required confirmations on the funding transaction before the funding will be
considered “locked”. This number is selected by the channel fundee (i.e. us if
is_outbound
is not set), and can be selected for inbound channels with
ChannelHandshakeConfig::minimum_depth
or limited for outbound channels with
ChannelHandshakeLimits::max_minimum_depth
.
This value will be None
for outbound channels until the counterparty accepts the channel.
force_close_spend_delay: Option<u16>
The number of blocks (after our commitment transaction confirms) that we will need to wait until we can claim our funds after we force-close the channel. During this time our counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty force-closes the channel and broadcasts a commitment transaction we do not have to wait any time to claim our non-HTLC-encumbered funds.
This value will be None
for outbound channels until the counterparty accepts the channel.
is_outbound: bool
True if the channel was initiated (and thus funded) by us.
is_funding_locked: bool
True if the channel is confirmed, funding_locked messages have been exchanged, and the
channel is not currently being shut down. funding_locked
message exchange implies the
required confirmation count has been reached (and we were connected to the peer at some
point after the funding transaction received enough confirmations). The required
confirmation count is provided in confirmations_required
.
is_usable: bool
True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b) the peer is connected, and (c) the channel is not currently negotiating a shutdown.
This is a strict superset of is_funding_locked
.
is_public: bool
True if this channel is (or will be) publicly-announced.
Trait Implementations
sourceimpl Clone for ChannelDetails
impl Clone for ChannelDetails
sourcefn clone(&self) -> ChannelDetails
fn clone(&self) -> ChannelDetails
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ChannelDetails
impl Debug for ChannelDetails
sourceimpl PartialEq<ChannelDetails> for ChannelDetails
impl PartialEq<ChannelDetails> for ChannelDetails
sourcefn eq(&self, other: &ChannelDetails) -> bool
fn eq(&self, other: &ChannelDetails) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ChannelDetails) -> bool
fn ne(&self, other: &ChannelDetails) -> bool
This method tests for !=
.
sourceimpl Readable for ChannelDetails
impl Readable for ChannelDetails
sourceimpl Writeable for ChannelDetails
impl Writeable for ChannelDetails
sourcefn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>
fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>
Writes self out to the given Writer
sourcefn serialized_length(&self) -> usize
fn serialized_length(&self) -> usize
Gets the length of this object after it has been serialized. This can be overridden to optimize cases where we prepend an object with its length. Read more
impl StructuralPartialEq for ChannelDetails
Auto Trait Implementations
impl RefUnwindSafe for ChannelDetails
impl Send for ChannelDetails
impl Sync for ChannelDetails
impl Unpin for ChannelDetails
impl UnwindSafe for ChannelDetails
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> MaybeReadable for T where
T: Readable,
impl<T> MaybeReadable for T where
T: Readable,
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more