Struct lightning::util::config::ChannelConfig[][src]

pub struct ChannelConfig {
    pub forwarding_fee_proportional_millionths: u32,
    pub forwarding_fee_base_msat: u32,
    pub cltv_expiry_delta: u16,
    pub announced_channel: bool,
    pub commit_upfront_shutdown_pubkey: bool,
}
Expand description

Options which apply on a per-channel basis and may change at runtime or based on negotiation with our counterparty.

Fields

forwarding_fee_proportional_millionths: u32

Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound over the channel. This may be allowed to change at runtime in a later update, however doing so must result in update messages sent to notify all nodes of our updated relay fee.

Default value: 0.

forwarding_fee_base_msat: u32

Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in excess of forwarding_fee_proportional_millionths. This may be allowed to change at runtime in a later update, however doing so must result in update messages sent to notify all nodes of our updated relay fee.

The default value of a single satoshi roughly matches the market rate on many routing nodes as of July 2021. Adjusting it upwards or downwards may change whether nodes route through this node.

Default value: 1000.

cltv_expiry_delta: u16

The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over the channel this config applies to.

This is analogous to ChannelHandshakeConfig::our_to_self_delay but applies to in-flight HTLC balance when a channel appears on-chain whereas ChannelHandshakeConfig::our_to_self_delay applies to the remaining (non-HTLC-encumbered) balance.

Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed, we (or one of our watchtowers) MUST be online to check for broadcast of the current commitment transaction at least once per this many blocks (minus some margin to allow us enough time to broadcast and confirm a transaction, possibly with time in between to RBF the spending transaction).

Default value: 72 (12 hours at an average of 6 blocks/hour). Minimum value: MIN_CLTV_EXPIRY_DELTA, any values less than this will be treated as MIN_CLTV_EXPIRY_DELTA instead.

announced_channel: bool

Set to announce the channel publicly and notify all nodes that they can route via this channel.

This should only be set to true for nodes which expect to be online reliably.

As the node which funds a channel picks this value this will only apply for new outbound channels unless ChannelHandshakeLimits::force_announced_channel_preference is set.

This cannot be changed after the initial channel handshake.

Default value: false.

commit_upfront_shutdown_pubkey: bool

When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty supports it, they will then enforce the mutual-close output to us matches what we provided at intialization, preventing us from closing to an alternate pubkey.

This is set to true by default to provide a slight increase in security, though ultimately any attacker who is able to take control of a channel can just as easily send the funds via lightning payments, so we never require that our counterparties support this option.

This cannot be changed after a channel has been initialized.

Default value: true.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Provides sane defaults for most configurations (but with zero relay fees!).

Reads a Self in from the given Read

Writes self out to the given Writer

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

Writes self out to a Vec

Writes self out to a Vec

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.