Skip to content
Merged
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
23 changes: 22 additions & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ const DEFAULT_LDK_WALLET_SYNC_INTERVAL_SECS: u64 = 30;
const DEFAULT_FEE_RATE_CACHE_UPDATE_INTERVAL_SECS: u64 = 60 * 10;
const DEFAULT_PROBING_LIQUIDITY_LIMIT_MULTIPLIER: u64 = 3;
const DEFAULT_ANCHOR_PER_CHANNEL_RESERVE_SATS: u64 = 25_000;
// Alby: our project is well-tested and requires larger inbound channels,
// especially for business users.
const DEFAULT_MAX_INBOUND_CHANNEL_SIZE_SATS: u64 = 10 * 100_000_000;

/// The default log level.
pub const DEFAULT_LOG_LEVEL: LogLevel = LogLevel::Debug;
Expand Down Expand Up @@ -329,6 +332,10 @@ pub(crate) fn default_user_config(config: &Config) -> UserConfig {
// some of the values set here, e.g. the ChannelHandshakeConfig, meaning these default values
// will mostly be relevant for inbound channels.
let mut user_config = UserConfig::default();
// Alby: override LDK's default inbound channel limit to allow larger
// channels needed by well-tested deployments and business users.
user_config.channel_handshake_limits.max_funding_satoshis =
DEFAULT_MAX_INBOUND_CHANNEL_SIZE_SATS;
user_config.channel_handshake_limits.force_announced_channel_preference = false;
user_config.manually_accept_inbound_channels = true;
user_config.channel_handshake_config.negotiate_anchors_zero_fee_htlc_tx =
Expand Down Expand Up @@ -565,7 +572,21 @@ pub enum AsyncPaymentsRole {
mod tests {
use std::str::FromStr;

use super::{may_announce_channel, AnnounceError, Config, NodeAlias, SocketAddress};
use super::{
default_user_config, may_announce_channel, AnnounceError, Config, NodeAlias, SocketAddress,
DEFAULT_MAX_INBOUND_CHANNEL_SIZE_SATS,
};

#[test]
fn default_user_config_allows_10_btc_inbound_channels() {
let node_config = Config::default();
let user_config = default_user_config(&node_config);

assert_eq!(
user_config.channel_handshake_limits.max_funding_satoshis,
DEFAULT_MAX_INBOUND_CHANNEL_SIZE_SATS
);
}

#[test]
fn node_announce_channel() {
Expand Down
Loading