///
/// Default value: `2016`, which we also enforce as a maximum value so you can tweak config to
/// reduce the loss of having useless locked funds (if your peer accepts)
- pub their_to_self_delay: u16
+ pub their_to_self_delay: u16,
}
impl Default for ChannelHandshakeLimits {
impl ChannelConfig {
/// Applies the given [`ChannelConfigUpdate`] as a partial update to the [`ChannelConfig`].
pub fn apply(&mut self, update: &ChannelConfigUpdate) {
- if let Some(forwarding_fee_proportional_millionths) = update.forwarding_fee_proportional_millionths {
+ if let Some(forwarding_fee_proportional_millionths) =
+ update.forwarding_fee_proportional_millionths
+ {
self.forwarding_fee_proportional_millionths = forwarding_fee_proportional_millionths;
}
if let Some(forwarding_fee_base_msat) = update.forwarding_fee_base_msat {
if let Some(max_dust_htlc_exposure_msat) = update.max_dust_htlc_exposure_msat {
self.max_dust_htlc_exposure = max_dust_htlc_exposure_msat;
}
- if let Some(force_close_avoidance_max_fee_satoshis) = update.force_close_avoidance_max_fee_satoshis {
+ if let Some(force_close_avoidance_max_fee_satoshis) =
+ update.force_close_avoidance_max_fee_satoshis
+ {
self.force_close_avoidance_max_fee_satoshis = force_close_avoidance_max_fee_satoshis;
}
}
impl From<ChannelConfig> for ChannelConfigUpdate {
fn from(config: ChannelConfig) -> ChannelConfigUpdate {
ChannelConfigUpdate {
- forwarding_fee_proportional_millionths: Some(config.forwarding_fee_proportional_millionths),
+ forwarding_fee_proportional_millionths: Some(
+ config.forwarding_fee_proportional_millionths,
+ ),
forwarding_fee_base_msat: Some(config.forwarding_fee_base_msat),
cltv_expiry_delta: Some(config.cltv_expiry_delta),
max_dust_htlc_exposure_msat: Some(config.max_dust_htlc_exposure),
- force_close_avoidance_max_fee_satoshis: Some(config.force_close_avoidance_max_fee_satoshis),
+ force_close_avoidance_max_fee_satoshis: Some(
+ config.force_close_avoidance_max_fee_satoshis,
+ ),
}
}
}
});
let max_dust_htlc_exposure_msat_fixed_limit =
max_dust_htlc_exposure_msat_fixed_limit.unwrap_or(5_000_000);
- let max_dust_htlc_exposure_msat = max_dust_htlc_exposure_enum
- .unwrap_or(MaxDustHTLCExposure::FixedLimitMsat(max_dust_htlc_exposure_msat_fixed_limit));
+ let max_dust_htlc_exposure_msat = max_dust_htlc_exposure_enum.unwrap_or(
+ MaxDustHTLCExposure::FixedLimitMsat(max_dust_htlc_exposure_msat_fixed_limit),
+ );
Ok(Self {
options: ChannelConfig {
forwarding_fee_proportional_millionths,