Channel

Struct Channel 

Source
pub struct Channel {
Show 37 fields pub active: bool, pub remote_pubkey: String, pub channel_point: String, pub chan_id: u64, pub capacity: i64, pub local_balance: i64, pub remote_balance: i64, pub commit_fee: i64, pub commit_weight: i64, pub fee_per_kw: i64, pub unsettled_balance: i64, pub total_satoshis_sent: i64, pub total_satoshis_received: i64, pub num_updates: u64, pub pending_htlcs: Vec<Htlc>, pub csv_delay: u32, pub private: bool, pub initiator: bool, pub chan_status_flags: String, pub local_chan_reserve_sat: i64, pub remote_chan_reserve_sat: i64, pub static_remote_key: bool, pub commitment_type: i32, pub lifetime: i64, pub uptime: i64, pub close_address: String, pub push_amount_sat: u64, pub thaw_height: u32, pub local_constraints: Option<ChannelConstraints>, pub remote_constraints: Option<ChannelConstraints>, pub alias_scids: Vec<u64>, pub zero_conf: bool, pub zero_conf_confirmed_scid: u64, pub peer_alias: String, pub peer_scid_alias: u64, pub memo: String, pub custom_channel_data: Vec<u8>,
}

Fields§

§active: bool

Whether this channel is active or not

§remote_pubkey: String

The identity pubkey of the remote node

§channel_point: String

The outpoint (txid:index) of the funding transaction. With this value, Bob will be able to generate a signature for Alice’s version of the commitment transaction.

§chan_id: u64

The unique channel ID for the channel. The first 3 bytes are the block height, the next 3 the index within the block, and the last 2 bytes are the output index for the channel.

§capacity: i64

The total amount of funds held in this channel

§local_balance: i64

This node’s current balance in this channel

§remote_balance: i64

The counterparty’s current balance in this channel

§commit_fee: i64

The amount calculated to be paid in fees for the current set of commitment transactions. The fee amount is persisted with the channel in order to allow the fee amount to be removed and recalculated with each channel state update, including updates that happen after a system restart.

§commit_weight: i64

The weight of the commitment transaction

§fee_per_kw: i64

The required number of satoshis per kilo-weight that the requester will pay at all times, for both the funding transaction and commitment transaction. This value can later be updated once the channel is open.

§unsettled_balance: i64

The unsettled balance in this channel

§total_satoshis_sent: i64

The total number of satoshis we’ve sent within this channel.

§total_satoshis_received: i64

The total number of satoshis we’ve received within this channel.

§num_updates: u64

The total number of updates conducted within this channel.

§pending_htlcs: Vec<Htlc>

The list of active, uncleared HTLCs currently pending within the channel.

§csv_delay: u32
👎Deprecated

Deprecated. The CSV delay expressed in relative blocks. If the channel is force closed, we will need to wait for this many blocks before we can regain our funds.

§private: bool

Whether this channel is advertised to the network or not.

§initiator: bool

True if we were the ones that created the channel.

§chan_status_flags: String

A set of flags showing the current state of the channel.

§local_chan_reserve_sat: i64
👎Deprecated

Deprecated. The minimum satoshis this node is required to reserve in its balance.

§remote_chan_reserve_sat: i64
👎Deprecated

Deprecated. The minimum satoshis the other node is required to reserve in its balance.

§static_remote_key: bool
👎Deprecated

Deprecated. Use commitment_type.

§commitment_type: i32

The commitment type used by this channel.

§lifetime: i64

The number of seconds that the channel has been monitored by the channel scoring system. Scores are currently not persisted, so this value may be less than the lifetime of the channel [EXPERIMENTAL].

§uptime: i64

The number of seconds that the remote peer has been observed as being online by the channel scoring system over the lifetime of the channel [EXPERIMENTAL].

§close_address: String

Close address is the address that we will enforce payout to on cooperative close if the channel was opened utilizing option upfront shutdown. This value can be set on channel open by setting close_address in an open channel request. If this value is not set, you can still choose a payout address by cooperatively closing with the delivery_address field set.

§push_amount_sat: u64

The amount that the initiator of the channel optionally pushed to the remote party on channel open. This amount will be zero if the channel initiator did not push any funds to the remote peer. If the initiator field is true, we pushed this amount to our peer, if it is false, the remote peer pushed this amount to us.

§thaw_height: u32

This uint32 indicates if this channel is to be considered ‘frozen’. A frozen channel doest not allow a cooperative channel close by the initiator. The thaw_height is the height that this restriction stops applying to the channel. This field is optional, not setting it or using a value of zero will mean the channel has no additional restrictions. The height can be interpreted in two ways: as a relative height if the value is less than 500,000, or as an absolute height otherwise.

§local_constraints: Option<ChannelConstraints>

List constraints for the local node.

§remote_constraints: Option<ChannelConstraints>

List constraints for the remote node.

§alias_scids: Vec<u64>

This lists out the set of alias short channel ids that exist for a channel. This may be empty.

§zero_conf: bool

Whether or not this is a zero-conf channel.

§zero_conf_confirmed_scid: u64

This is the confirmed / on-chain zero-conf SCID.

§peer_alias: String

The configured alias name of our peer.

§peer_scid_alias: u64

This is the peer SCID alias.

§memo: String

An optional note-to-self to go along with the channel containing some useful information. This is only ever stored locally and in no way impacts the channel’s operation.

§custom_channel_data: Vec<u8>

Custom channel data that might be populated in custom channels.

Implementations§

Source§

impl Channel

Source

pub fn commitment_type(&self) -> CommitmentType

Returns the enum value of commitment_type, or the default if the field is set to an invalid enum value.

Source

pub fn set_commitment_type(&mut self, value: CommitmentType)

Sets commitment_type to the provided enum value.

Trait Implementations§

Source§

impl Clone for Channel

Source§

fn clone(&self) -> Channel

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Channel

Source§

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

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

impl Default for Channel

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Message for Channel

Source§

fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.
Source§

fn clear(&mut self)

Clears the message, resetting all fields to their default.
Source§

fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message to a buffer. Read more
Source§

fn encode_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message to a newly allocated buffer.
Source§

fn encode_length_delimited( &self, buf: &mut impl BufMut, ) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message with a length-delimiter to a buffer. Read more
Source§

fn encode_length_delimited_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message with a length-delimiter to a newly allocated buffer.
Source§

fn decode(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes an instance of the message from a buffer. Read more
Source§

fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes a length-delimited instance of the message from the buffer.
Source§

fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes an instance of the message from a buffer, and merges it into self. Read more
Source§

fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes a length-delimited instance of the message from buffer, and merges it into self.
Source§

impl PartialEq for Channel

Source§

fn eq(&self, other: &Channel) -> 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 Channel

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
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> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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