pub struct Channel {Show 20 fields
pub channel_id: Hash256,
pub is_public: bool,
pub is_acceptor: bool,
pub is_one_way: bool,
pub channel_outpoint: Option<OutPoint>,
pub pubkey: Pubkey,
pub funding_udt_type_script: Option<Script>,
pub state: ChannelState,
pub local_balance: u128,
pub offered_tlc_balance: u128,
pub remote_balance: u128,
pub received_tlc_balance: u128,
pub pending_tlcs: Vec<Htlc>,
pub latest_commitment_transaction_hash: Option<H256>,
pub created_at: u64,
pub enabled: bool,
pub tlc_expiry_delta: u64,
pub tlc_fee_proportional_millionths: u128,
pub shutdown_transaction_hash: Option<H256>,
pub failure_detail: Option<String>,
}Expand description
The channel data structure.
Fields§
§channel_id: Hash256The channel ID
is_public: boolWhether the channel is public
is_acceptor: boolIs this channel initially inbound? An inbound channel is one where the counterparty is the funder of the channel.
is_one_way: boolIs this channel one-way? Combines with is_acceptor to determine if the channel able to send payment to the counterparty or not.
channel_outpoint: Option<OutPoint>The outpoint of the channel
pubkey: PubkeyThe public key of the channel counterparty.
funding_udt_type_script: Option<Script>The UDT type script of the channel
state: ChannelStateThe state of the channel
local_balance: u128The local balance of the channel
offered_tlc_balance: u128The offered balance of the channel
remote_balance: u128The remote balance of the channel
received_tlc_balance: u128The received balance of the channel
pending_tlcs: Vec<Htlc>The list of pending tlcs
latest_commitment_transaction_hash: Option<H256>The hash of the latest commitment transaction
created_at: u64The time the channel was created at, in milliseconds from UNIX epoch
enabled: boolWhether the channel is enabled
tlc_expiry_delta: u64The expiry delta to forward a tlc, in milliseconds, default to 1 day, which is 24 * 60 * 60 * 1000 milliseconds
This parameter can be updated with rpc update_channel later.
tlc_fee_proportional_millionths: u128The fee proportional millionths for a TLC, proportional to the amount of the forwarded tlc.
The unit is millionths of the amount. default is 1000 which means 0.1%.
This parameter can be updated with rpc update_channel later.
Not that, we use outbound channel to calculate the fee for TLC forwarding. For example,
if we have a path A -> B -> C, then the fee B requires for TLC forwarding, is calculated
the channel configuration of B and C, not A and B.
shutdown_transaction_hash: Option<H256>The hash of the shutdown transaction
failure_detail: Option<String>Human-readable reason why the channel opening failed. Only present when the channel is in a failed state (e.g. abandoned or funding aborted).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Channel
impl<'de> Deserialize<'de> for Channel
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for Channel
impl JsonSchema for Channel
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more