Skip to content

Commit 59ef00a

Browse files
fix: use LDK default for min_funding_satoshis instead of hardcoded constant
Derive min_funding_sats default from ChannelHandshakeLimits::default() to avoid the values getting out-of-sync between LDK and LDK Node. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 0aad750 commit 59ef00a

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/config.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ use lightning::ln::msgs::SocketAddress;
1616
use lightning::routing::gossip::NodeAlias;
1717
use lightning::routing::router::RouteParametersConfig;
1818
use lightning::util::config::{
19-
ChannelConfig as LdkChannelConfig, MaxDustHTLCExposure as LdkMaxDustHTLCExposure, UserConfig,
19+
ChannelConfig as LdkChannelConfig, ChannelHandshakeLimits,
20+
MaxDustHTLCExposure as LdkMaxDustHTLCExposure, UserConfig,
2021
};
2122

2223
use crate::logger::LogLevel;
@@ -28,7 +29,6 @@ const DEFAULT_LDK_WALLET_SYNC_INTERVAL_SECS: u64 = 30;
2829
const DEFAULT_FEE_RATE_CACHE_UPDATE_INTERVAL_SECS: u64 = 60 * 10;
2930
const DEFAULT_PROBING_LIQUIDITY_LIMIT_MULTIPLIER: u64 = 3;
3031
const DEFAULT_ANCHOR_PER_CHANNEL_RESERVE_SATS: u64 = 25_000;
31-
const DEFAULT_MIN_FUNDING_SATS: u64 = 1_000;
3232

3333
// The default timeout after which we abort a wallet syncing operation.
3434
const DEFAULT_BDK_WALLET_SYNC_TIMEOUT_SECS: u64 = 60;
@@ -126,7 +126,7 @@ pub(crate) const LNURL_AUTH_TIMEOUT_SECS: u64 = 15;
126126
/// | `node_alias` | None |
127127
/// | `trusted_peers_0conf` | [] |
128128
/// | `probing_liquidity_limit_multiplier` | 3 |
129-
/// | `min_funding_sats` | 1000 |
129+
/// | `min_funding_sats` | LDK default |
130130
/// | `anchor_channels_config` | Some(..) |
131131
/// | `route_parameters` | None |
132132
/// | `tor_config` | None |
@@ -174,7 +174,8 @@ pub struct Config {
174174
///
175175
/// Channels with funding below this value will be rejected.
176176
///
177-
/// Please refer to [`ChannelHandshakeLimits::min_funding_satoshis`] for further details.
177+
/// Defaults to the `rust-lightning` value of
178+
/// [`ChannelHandshakeLimits::min_funding_satoshis`].
178179
///
179180
/// [`ChannelHandshakeLimits::min_funding_satoshis`]: lightning::util::config::ChannelHandshakeLimits::min_funding_satoshis
180181
pub min_funding_sats: u64,
@@ -221,7 +222,7 @@ impl Default for Config {
221222
announcement_addresses: None,
222223
trusted_peers_0conf: Vec::new(),
223224
probing_liquidity_limit_multiplier: DEFAULT_PROBING_LIQUIDITY_LIMIT_MULTIPLIER,
224-
min_funding_sats: DEFAULT_MIN_FUNDING_SATS,
225+
min_funding_sats: ChannelHandshakeLimits::default().min_funding_satoshis,
225226
anchor_channels_config: Some(AnchorChannelsConfig::default()),
226227
tor_config: None,
227228
route_parameters: None,

0 commit comments

Comments
 (0)