pub struct ChannelHandshakeConfig {
pub minimum_depth: u32,
pub our_to_self_delay: u16,
pub our_htlc_minimum_msat: u64,
pub negotiate_scid_privacy: bool,
}
Expand description
Configuration we set when applicable.
Default::default() provides sane defaults.
Fields
minimum_depth: u32
Confirmations we will wait for before considering the channel locked in. Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the equivalent limit applied to outbound channels).
Default value: 6.
our_to_self_delay: u16
Set to the number of blocks we require our counterparty to wait to claim their money (ie the number of blocks we have to punish our counterparty if they broadcast a revoked transaction).
This is one of the main parameters of our security model. We (or one of our watchtowers) MUST be online to check for revoked transactions on-chain at least once every our_to_self_delay 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).
Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in case of an honest unilateral channel close, which implicitly decrease the economic value of our channel.
Default value: BREAKDOWN_TIMEOUT
, we enforce it as a minimum at channel opening so you
can tweak config to ask for more security, not less.
our_htlc_minimum_msat: u64
Set to the smallest value HTLC we will accept to process.
This value is sent to our counterparty on channel-open and we close the channel any time our counterparty misbehaves by sending us an HTLC with a value smaller than this.
Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required by the protocol.
negotiate_scid_privacy: bool
If set, we attempt to negotiate the scid_privacy
(referred to as scid_alias
in the
BOLTs) option for outbound private channels. This provides better privacy by not including
our real on-chain channel UTXO in each invoice and requiring that our counterparty only
relay HTLCs to us using the channel’s SCID alias.
If this option is set, channels may be created that will not be readable by LDK versions
prior to 0.0.106, causing ChannelManager
’s read method to return a
DecodeError:InvalidValue
.
Note that setting this to true does not prevent us from opening channels with
counterparties that do not support the scid_alias
option; we will simply fall back to a
private channel without that option.
Ignored if the channel is negotiated to be announced, see
ChannelConfig::announced_channel
and
ChannelHandshakeLimits::force_announced_channel_preference
for more.
Default value: false. This value is likely to change to true in the future.
Trait Implementations
sourceimpl Clone for ChannelHandshakeConfig
impl Clone for ChannelHandshakeConfig
sourcefn clone(&self) -> ChannelHandshakeConfig
fn clone(&self) -> ChannelHandshakeConfig
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ChannelHandshakeConfig
impl Debug for ChannelHandshakeConfig
sourceimpl Default for ChannelHandshakeConfig
impl Default for ChannelHandshakeConfig
sourcefn default() -> ChannelHandshakeConfig
fn default() -> ChannelHandshakeConfig
Returns the “default value” for a type. Read more
impl Copy for ChannelHandshakeConfig
Auto Trait Implementations
impl RefUnwindSafe for ChannelHandshakeConfig
impl Send for ChannelHandshakeConfig
impl Sync for ChannelHandshakeConfig
impl Unpin for ChannelHandshakeConfig
impl UnwindSafe for ChannelHandshakeConfig
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more