@@ -105,11 +105,14 @@ pub struct ChannelHandshakeLimits {
105
105
///
106
106
/// Default value: 144, or roughly one day and only applies to outbound channels.
107
107
pub max_minimum_depth : u32 ,
108
- /// Set to force the incoming channel to match our announced channel preference in
109
- /// ChannelConfig.
108
+ /// Set to force an incoming channel to match our announced channel preference in
109
+ /// [` ChannelConfig::announced_channel`] .
110
110
///
111
- /// Default value: true, to make the default that no announced channels are possible (which is
112
- /// appropriate for any nodes which are not online very reliably).
111
+ /// For a node which is not online reliably, this should be set to true and
112
+ /// [`ChannelConfig::announced_channel`] set to false, ensuring that no announced (aka public)
113
+ /// channels will ever be opened.
114
+ ///
115
+ /// Default value: true.
113
116
pub force_announced_channel_preference : bool ,
114
117
/// Set to the amount of time we're willing to wait to claim money back to us.
115
118
///
@@ -179,7 +182,7 @@ pub struct ChannelConfig {
179
182
/// This should only be set to true for nodes which expect to be online reliably.
180
183
///
181
184
/// As the node which funds a channel picks this value this will only apply for new outbound
182
- /// channels unless ChannelHandshakeLimits::force_announced_channel_preferences is set.
185
+ /// channels unless [` ChannelHandshakeLimits::force_announced_channel_preference`] is set.
183
186
///
184
187
/// This cannot be changed after the initial channel handshake.
185
188
///
@@ -233,6 +236,23 @@ pub struct UserConfig {
233
236
pub peer_channel_config_limits : ChannelHandshakeLimits ,
234
237
/// Channel config which affects behavior during channel lifetime.
235
238
pub channel_options : ChannelConfig ,
239
+ /// If a channel is not set to be publicly announced, we reject HTLCs which were set to be
240
+ /// forwarded over the channel if this is set to false. This prevents use from taking on
241
+ /// HTLC-forwarding risk when we intend to run as a node which is not online reliably.
242
+ ///
243
+ /// For nodes which are not online reliably, you should set all channels to *not* be announced
244
+ /// (using [`ChannelConfig::announced_channel`] and
245
+ /// [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
246
+ /// ensure you are not exposed to any forwarding risk.
247
+ ///
248
+ /// Note that because you cannot change a channel's announced state after creation, there is no
249
+ /// way to disable forwarding on public channels retroactively. Thus, in order to change a node
250
+ /// from a publicly-announced forwarding node to a private non-forwarding node you must close
251
+ /// all your channels and open new ones. For privacy, you should also change your node_id
252
+ /// (swapping all private and public key material for new ones) at that time.
253
+ ///
254
+ /// Default value: false.
255
+ pub accept_forwards_to_priv_channels : bool ,
236
256
}
237
257
238
258
impl Default for UserConfig {
@@ -241,6 +261,7 @@ impl Default for UserConfig {
241
261
own_channel_config : ChannelHandshakeConfig :: default ( ) ,
242
262
peer_channel_config_limits : ChannelHandshakeLimits :: default ( ) ,
243
263
channel_options : ChannelConfig :: default ( ) ,
264
+ accept_forwards_to_priv_channels : false ,
244
265
}
245
266
}
246
267
}
0 commit comments