pub struct ChannelBalance {
pub claimable: u64,
pub received_htlc: u64,
pub offered_htlc: u64,
pub sweeping: u64,
pub stub_count: u32,
pub unconfirmed_count: u32,
pub channel_count: u32,
pub closing_count: u32,
pub received_htlc_count: u32,
pub offered_htlc_count: u32,
}
Expand description
Balances associated with a channel See: https://gitlab.com/lightning-signer/docs/-/wikis/Proposed-L1-and-Channel-Balance-Reconciliation
All channels that VLS knows about are in one of the four categories:
- channel stubs: assigned channelid and can generate points, keys, …
- unconfirmed channels: negotiated channels prior to
channel_ready
- channels: active channels in their normal operating mode
- closing channels: closed channels being swept or aged prior to pruning
Fields§
§claimable: u64
Claimable balance on open channel
received_htlc: u64
Sum of htlcs offered to us
offered_htlc: u64
Sum of htlcs we offered
sweeping: u64
Sweeping to wallet
stub_count: u32
Current number of channel stubs
unconfirmed_count: u32
Current number of unconfirmed channels
channel_count: u32
Current number of active channels
closing_count: u32
Current number of closing channels
received_htlc_count: u32
Current number of received htlcs
offered_htlc_count: u32
Current number of offered htlcs
Implementations§
Source§impl ChannelBalance
impl ChannelBalance
Sourcepub fn new(
claimable: u64,
received_htlc: u64,
offered_htlc: u64,
sweeping: u64,
stub_count: u32,
unconfirmed_count: u32,
channel_count: u32,
closing_count: u32,
received_htlc_count: u32,
offered_htlc_count: u32,
) -> ChannelBalance
pub fn new( claimable: u64, received_htlc: u64, offered_htlc: u64, sweeping: u64, stub_count: u32, unconfirmed_count: u32, channel_count: u32, closing_count: u32, received_htlc_count: u32, offered_htlc_count: u32, ) -> ChannelBalance
Create a ChannelBalance with specific values
Sourcepub fn zero() -> ChannelBalance
pub fn zero() -> ChannelBalance
Create a ChannelBalance with zero values
Sourcepub fn stub() -> ChannelBalance
pub fn stub() -> ChannelBalance
Create a ChannelBalance for a stub
Sourcepub fn accumulate(&mut self, other: &ChannelBalance)
pub fn accumulate(&mut self, other: &ChannelBalance)
Sum channel balances
Trait Implementations§
Source§impl Debug for ChannelBalance
impl Debug for ChannelBalance
Source§impl PartialEq for ChannelBalance
impl PartialEq for ChannelBalance
impl StructuralPartialEq for ChannelBalance
Auto Trait Implementations§
impl Freeze for ChannelBalance
impl RefUnwindSafe for ChannelBalance
impl Send for ChannelBalance
impl Sync for ChannelBalance
impl Unpin for ChannelBalance
impl UnwindSafe for ChannelBalance
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more