@@ -67,17 +67,17 @@ pub struct ChannelHandshakeConfig {
67
67
///
68
68
/// Note that:
69
69
/// * If configured to another value than the default value `10`, any new channels created with
70
- /// the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
71
- /// `ChannelManager`.
70
+ /// the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
71
+ /// `ChannelManager`.
72
72
///
73
73
/// * This caps the total value for inbound HTLCs in-flight only, and there's currently
74
- /// no way to configure the cap for the total value of outbound HTLCs in-flight.
74
+ /// no way to configure the cap for the total value of outbound HTLCs in-flight.
75
75
///
76
76
/// * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
77
- /// are different from the non-HTLC-encumbered funds. This makes this an important knob to
78
- /// restrict exposure to loss due to being offline for too long.
79
- /// See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
80
- /// for more information.
77
+ /// are different from the non-HTLC-encumbered funds. This makes this an important knob to
78
+ /// restrict exposure to loss due to being offline for too long.
79
+ /// See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
80
+ /// for more information.
81
81
///
82
82
/// Default value: `10`
83
83
///
@@ -257,7 +257,8 @@ pub struct ChannelHandshakeLimits {
257
257
/// Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
258
258
/// only applies to inbound channels.
259
259
///
260
- /// Default value: `0`
260
+ /// Default value: `1000`
261
+ /// (Minimum of [`ChannelHandshakeConfig::their_channel_reserve_proportional_millionths`])
261
262
pub min_funding_satoshis : u64 ,
262
263
/// Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
263
264
/// only applies to inbound channels.
@@ -332,11 +333,11 @@ pub struct ChannelHandshakeLimits {
332
333
impl Default for ChannelHandshakeLimits {
333
334
fn default ( ) -> Self {
334
335
ChannelHandshakeLimits {
335
- min_funding_satoshis : 0 ,
336
+ min_funding_satoshis : 1000 ,
336
337
max_funding_satoshis : MAX_FUNDING_SATOSHIS_NO_WUMBO ,
337
- max_htlc_minimum_msat : < u64 > :: max_value ( ) ,
338
+ max_htlc_minimum_msat : u64:: MAX ,
338
339
min_max_htlc_value_in_flight_msat : 0 ,
339
- max_channel_reserve_satoshis : < u64 > :: max_value ( ) ,
340
+ max_channel_reserve_satoshis : u64:: MAX ,
340
341
min_max_accepted_htlcs : 0 ,
341
342
trust_own_funding_0conf : true ,
342
343
max_minimum_depth : 144 ,
@@ -388,10 +389,10 @@ pub enum MaxDustHTLCExposure {
388
389
/// `FeeRateMultiplier(10_000)`:
389
390
///
390
391
/// - For the minimum fee rate of 1 sat/vByte (250 sat/KW, although the minimum
391
- /// defaults to 253 sats/KW for rounding, see [`FeeEstimator`]), the max dust exposure would
392
- /// be 253 * 10_000 = 2,530,000 msats.
392
+ /// defaults to 253 sats/KW for rounding, see [`FeeEstimator`]), the max dust exposure would
393
+ /// be 253 * 10_000 = 2,530,000 msats.
393
394
/// - For a fee rate of 30 sat/vByte (7500 sat/KW), the max dust exposure would be
394
- /// 7500 * 50_000 = 75,000,000 msats (0.00075 BTC).
395
+ /// 7500 * 50_000 = 75,000,000 msats (0.00075 BTC).
395
396
///
396
397
/// Note, if you're using a third-party fee estimator, this may leave you more exposed to a
397
398
/// fee griefing attack, where your fee estimator may purposely overestimate the fee rate,
@@ -670,6 +671,7 @@ impl crate::util::ser::Readable for ChannelConfig {
670
671
671
672
/// A parallel struct to [`ChannelConfig`] to define partial updates.
672
673
#[ allow( missing_docs) ]
674
+ #[ derive( Default ) ]
673
675
pub struct ChannelConfigUpdate {
674
676
pub forwarding_fee_proportional_millionths : Option < u32 > ,
675
677
pub forwarding_fee_base_msat : Option < u32 > ,
@@ -678,18 +680,6 @@ pub struct ChannelConfigUpdate {
678
680
pub force_close_avoidance_max_fee_satoshis : Option < u64 > ,
679
681
}
680
682
681
- impl Default for ChannelConfigUpdate {
682
- fn default ( ) -> ChannelConfigUpdate {
683
- ChannelConfigUpdate {
684
- forwarding_fee_proportional_millionths : None ,
685
- forwarding_fee_base_msat : None ,
686
- cltv_expiry_delta : None ,
687
- max_dust_htlc_exposure_msat : None ,
688
- force_close_avoidance_max_fee_satoshis : None ,
689
- }
690
- }
691
- }
692
-
693
683
impl From < ChannelConfig > for ChannelConfigUpdate {
694
684
fn from ( config : ChannelConfig ) -> ChannelConfigUpdate {
695
685
ChannelConfigUpdate {
0 commit comments