/// Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
#[derive(Clone, Debug)]
pub struct UserConfig {
- /// Limits applied during channel creation.
- pub channel_limits: ChannelHandshakeLimits,
+ /// Channel config that we propose to our counterparty.
+ pub own_channel_config: ChannelHandshakeConfig,
+ /// Limits applied to our counterparty's proposed channel config settings.
+ pub peer_channel_config_limits: ChannelHandshakeLimits,
/// Channel config which affects behavior during channel lifetime.
pub channel_options: ChannelConfig,
}
/// Provides sane defaults for most configurations (but with 0 relay fees!)
pub fn new() -> Self{
UserConfig {
- channel_limits: ChannelHandshakeLimits::new(),
+ own_channel_config: ChannelHandshakeConfig::new(),
+ peer_channel_config_limits: ChannelHandshakeLimits::new(),
channel_options: ChannelConfig::new(),
}
}
}
+/// Configuration we set when applicable.
+#[derive(Clone, Debug)]
+pub struct ChannelHandshakeConfig {
+ /// 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).
+ pub minimum_depth: u32,
+}
+
+impl ChannelHandshakeConfig {
+ /// Provides sane defaults for `ChannelHandshakeConfig`
+ pub fn new() -> ChannelHandshakeConfig {
+ ChannelHandshakeConfig {
+ minimum_depth: 6,
+ }
+ }
+}
+
/// Optional channel limits which are applied during channel creation.
///
/// These limits are only applied to our counterparty's limits, not our own.