Skip to content

Commit 1e6b519

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 289f765 commit 1e6b519

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
@@ -113,7 +113,8 @@ pub const WALLET_KEYS_SEED_LEN: usize = 64;
113113
/// | `probing_liquidity_limit_multiplier` | 3 |
114114
/// | `log_level` | Debug |
115115
/// | `anchor_channels_config` | Some(..) |
116-
/// | `route_parameters` | None |
116+
/// | `route_parameters` | None |
117+
/// | `reject_inbound_splices` | true |
117118
///
118119
/// See [`AnchorChannelsConfig`] and [`RouteParametersConfig`] for more information regarding their
119120
/// respective default values.
@@ -178,6 +179,15 @@ pub struct Config {
178179
/// **Note:** If unset, default parameters will be used, and you will be able to override the
179180
/// parameters on a per-payment basis in the corresponding method calls.
180181
pub route_parameters: Option<RouteParametersConfig>,
182+
/// If this is set to `true`, then inbound channel splice requests will be rejected. This
183+
/// ensures backwards compatibility is not broken with LDK Node v0.6 or prior while a splice is
184+
/// pending.
185+
///
186+
/// Outbound channel splice requests (via [`Node`] methods, an opt-in API) are still allowed as
187+
/// users should be aware of the backwards compatibility risk prior to using the functionality.
188+
///
189+
/// [`Node`]: crate::Node
190+
pub reject_inbound_splices: bool,
181191
}
182192

183193
impl Default for Config {
@@ -192,6 +202,7 @@ impl Default for Config {
192202
anchor_channels_config: Some(AnchorChannelsConfig::default()),
193203
route_parameters: None,
194204
node_alias: None,
205+
reject_inbound_splices: true,
195206
}
196207
}
197208
}
@@ -319,6 +330,7 @@ pub(crate) fn default_user_config(config: &Config) -> UserConfig {
319330
user_config.manually_accept_inbound_channels = true;
320331
user_config.channel_handshake_config.negotiate_anchors_zero_fee_htlc_tx =
321332
config.anchor_channels_config.is_some();
333+
user_config.reject_inbound_splices = config.reject_inbound_splices;
322334

323335
if may_announce_channel(config).is_err() {
324336
user_config.accept_forwards_to_priv_channels = false;

0 commit comments

Comments
 (0)