Struct ChannelBalance

Source
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:

  1. channel stubs: assigned channelid and can generate points, keys, …
  2. unconfirmed channels: negotiated channels prior to channel_ready
  3. channels: active channels in their normal operating mode
  4. 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

Source

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

Source

pub fn zero() -> ChannelBalance

Create a ChannelBalance with zero values

Source

pub fn stub() -> ChannelBalance

Create a ChannelBalance for a stub

Source

pub fn accumulate(&mut self, other: &ChannelBalance)

Sum channel balances

Trait Implementations§

Source§

impl Debug for ChannelBalance

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for ChannelBalance

Source§

fn eq(&self, other: &ChannelBalance) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for ChannelBalance

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more