Skip to content

Commit bf4ddff

Browse files
committed
Add default SendingParameters to node config
Introduced `sending_parameters_config` to `Config` for node-wide routing and pathfinding configuration. Also, added default values for `SendingParameters` to ensure reasonable defaults when no custom settings are provided by the user.
1 parent 5fe90d1 commit bf4ddff

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

bindings/ldk_node.udl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ dictionary Config {
1616
u64 probing_liquidity_limit_multiplier;
1717
LogLevel log_level;
1818
AnchorChannelsConfig? anchor_channels_config;
19+
SendingParameters? sending_parameters_config;
1920
};
2021

2122
dictionary AnchorChannelsConfig {

src/config.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
use std::time::Duration;
22

3+
use crate::payment::SendingParameters;
4+
35
use lightning::ln::msgs::SocketAddress;
46
use lightning::util::config::UserConfig;
57
use lightning::util::logger::Level as LogLevel;
@@ -86,6 +88,7 @@ pub(crate) const WALLET_KEYS_SEED_LEN: usize = 64;
8688
/// | `probing_liquidity_limit_multiplier` | 3 |
8789
/// | `log_level` | Debug |
8890
/// | `anchor_channels_config` | Some(..) |
91+
/// | `sending_parameters_config` | None |
8992
///
9093
/// See [`AnchorChannelsConfig`] for more information on its respective default values.
9194
///
@@ -147,6 +150,12 @@ pub struct Config {
147150
/// closure. We *will* however still try to get the Anchor spending transactions confirmed
148151
/// on-chain with the funds available.
149152
pub anchor_channels_config: Option<AnchorChannelsConfig>,
153+
154+
/// Configuration options for payment routing and pathfinding.
155+
///
156+
/// Setting the `SendingParameters` provides flexibility to customize how payments are routed,
157+
/// including setting limits on routing fees, CLTV expiry, and channel utilization.
158+
pub sending_parameters_config: Option<SendingParameters>,
150159
}
151160

152161
impl Default for Config {
@@ -164,6 +173,7 @@ impl Default for Config {
164173
probing_liquidity_limit_multiplier: DEFAULT_PROBING_LIQUIDITY_LIMIT_MULTIPLIER,
165174
log_level: DEFAULT_LOG_LEVEL,
166175
anchor_channels_config: Some(AnchorChannelsConfig::default()),
176+
sending_parameters_config: None,
167177
}
168178
}
169179
}

0 commit comments

Comments
 (0)