Skip to content

Commit 2d436c0

Browse files
committed
Add reject_inbound_splices Config parameter
By default LDK sets UserConfig::reject_inbound_splices to true, thus disallowing splices not specifically requested by the user. This ensures that a counterparty cannot break backwards compatibility. Expose this setting in LDK Node in order to enable splicing for interoperability testing.
1 parent 549985a commit 2d436c0

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/config.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ pub(crate) const EXTERNAL_PATHFINDING_SCORES_SYNC_TIMEOUT_SECS: u64 = 5;
119119
/// | `probing_liquidity_limit_multiplier` | 3 |
120120
/// | `log_level` | Debug |
121121
/// | `anchor_channels_config` | Some(..) |
122-
/// | `route_parameters` | None |
122+
/// | `route_parameters` | None |
123+
/// | `reject_inbound_splices` | true |
123124
///
124125
/// See [`AnchorChannelsConfig`] and [`RouteParametersConfig`] for more information regarding their
125126
/// respective default values.
@@ -184,6 +185,15 @@ pub struct Config {
184185
/// **Note:** If unset, default parameters will be used, and you will be able to override the
185186
/// parameters on a per-payment basis in the corresponding method calls.
186187
pub route_parameters: Option<RouteParametersConfig>,
188+
/// If this is set to `true`, then inbound channel splice requests will be rejected. This
189+
/// ensures backwards compatibility is not broken with LDK Node v0.6 or prior while a splice is
190+
/// pending.
191+
///
192+
/// Outbound channel splice requests (via [`Node`] methods, an opt-in API) are still allowed as
193+
/// users should be aware of the backwards compatibility risk prior to using the functionality.
194+
///
195+
/// [`Node`]: crate::Node
196+
pub reject_inbound_splices: bool,
187197
}
188198

189199
impl Default for Config {
@@ -198,6 +208,7 @@ impl Default for Config {
198208
anchor_channels_config: Some(AnchorChannelsConfig::default()),
199209
route_parameters: None,
200210
node_alias: None,
211+
reject_inbound_splices: true,
201212
}
202213
}
203214
}
@@ -325,6 +336,7 @@ pub(crate) fn default_user_config(config: &Config) -> UserConfig {
325336
user_config.manually_accept_inbound_channels = true;
326337
user_config.channel_handshake_config.negotiate_anchors_zero_fee_htlc_tx =
327338
config.anchor_channels_config.is_some();
339+
user_config.reject_inbound_splices = config.reject_inbound_splices;
328340

329341
if may_announce_channel(config).is_err() {
330342
user_config.accept_forwards_to_priv_channels = false;

0 commit comments

Comments
 (0)