X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Futil%2Fconfig.rs;fp=lightning%2Fsrc%2Futil%2Fconfig.rs;h=712b5937bab7ea2517f41cef155a7fe8d707c2b9;hb=3defcc896266f3d67848ce28981a756e971a3f0c;hp=c3726365996ae5b5cff69448aeb33c766ce82b54;hpb=af69fae97bcfeb3d9b3b4b84d37240f45e37bb85;p=rust-lightning diff --git a/lightning/src/util/config.rs b/lightning/src/util/config.rs index c3726365..712b5937 100644 --- a/lightning/src/util/config.rs +++ b/lightning/src/util/config.rs @@ -12,30 +12,6 @@ use ln::channelmanager::{BREAKDOWN_TIMEOUT, MAX_LOCAL_BREAKDOWN_TIMEOUT}; -/// Top-level config which holds ChannelHandshakeLimits and ChannelConfig. -/// -/// Default::default() provides sane defaults for most configurations -/// (but currently with 0 relay fees!) -#[derive(Clone, Debug)] -pub struct UserConfig { - /// 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, -} - -impl Default for UserConfig { - fn default() -> Self { - UserConfig { - own_channel_config: ChannelHandshakeConfig::default(), - peer_channel_config_limits: ChannelHandshakeLimits::default(), - channel_options: ChannelConfig::default(), - } - } -} - /// Configuration we set when applicable. /// /// Default::default() provides sane defaults. @@ -228,3 +204,27 @@ impl_writeable!(ChannelConfig, 8+1+1, { announced_channel, commit_upfront_shutdown_pubkey }); + +/// Top-level config which holds ChannelHandshakeLimits and ChannelConfig. +/// +/// Default::default() provides sane defaults for most configurations +/// (but currently with 0 relay fees!) +#[derive(Clone, Debug)] +pub struct UserConfig { + /// 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, +} + +impl Default for UserConfig { + fn default() -> Self { + UserConfig { + own_channel_config: ChannelHandshakeConfig::default(), + peer_channel_config_limits: ChannelHandshakeLimits::default(), + channel_options: ChannelConfig::default(), + } + } +}