Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ pub(crate) const LNURL_AUTH_TIMEOUT_SECS: u64 = 15;
/// | `node_alias` | None |
/// | `trusted_peers_0conf` | [] |
/// | `probing_liquidity_limit_multiplier` | 3 |
/// | `min_funding_sats` | None |
/// | `anchor_channels_config` | Some(..) |
/// | `route_parameters` | None |
/// | `tor_config` | None |
Expand Down Expand Up @@ -167,6 +168,17 @@ pub struct Config {
/// Channels with available liquidity less than the required amount times this value won't be
/// used to send pre-flight probes.
pub probing_liquidity_limit_multiplier: u64,
/// The minimum funding amount in satoshis that we require from channel counterparties when
/// they open inbound channels to us.
///
/// Channels with funding below this value will be rejected.
///
/// If unset, the `rust-lightning` default of `1000` sats will be used.
///
/// Please refer to [`ChannelHandshakeLimits::min_funding_satoshis`] for further details.
///
/// [`ChannelHandshakeLimits::min_funding_satoshis`]: lightning::util::config::ChannelHandshakeLimits::min_funding_satoshis
pub min_funding_sats: Option<u64>,
/// Configuration options pertaining to Anchor channels, i.e., channels for which the
/// `option_anchors_zero_fee_htlc_tx` channel type is negotiated.
///
Expand Down Expand Up @@ -210,6 +222,7 @@ impl Default for Config {
announcement_addresses: None,
trusted_peers_0conf: Vec::new(),
probing_liquidity_limit_multiplier: DEFAULT_PROBING_LIQUIDITY_LIMIT_MULTIPLIER,
min_funding_sats: None,
anchor_channels_config: Some(AnchorChannelsConfig::default()),
tor_config: None,
route_parameters: None,
Expand Down Expand Up @@ -339,6 +352,9 @@ pub(crate) fn default_user_config(config: &Config) -> UserConfig {
// will mostly be relevant for inbound channels.
let mut user_config = UserConfig::default();
user_config.channel_handshake_limits.force_announced_channel_preference = false;
if let Some(min_funding_sats) = config.min_funding_sats {
user_config.channel_handshake_limits.min_funding_satoshis = min_funding_sats;
}
user_config.channel_handshake_config.negotiate_anchors_zero_fee_htlc_tx =
config.anchor_channels_config.is_some();
user_config.reject_inbound_splices = false;
Expand Down
Loading