@@ -2233,8 +2233,9 @@ impl<M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelManager<M, T, K, F
2233
2233
None => { // unknown_next_peer
2234
2234
// Note that this is likely a timing oracle for detecting whether an scid is a
2235
2235
// phantom or an intercept.
2236
- if fake_scid:: is_valid_phantom ( & self . fake_scid_rand_bytes , * short_channel_id, & self . genesis_hash ) ||
2237
- fake_scid:: is_valid_intercept ( & self . fake_scid_rand_bytes , * short_channel_id, & self . genesis_hash )
2236
+ if ( self . default_configuration . accept_intercept_htlcs &&
2237
+ fake_scid:: is_valid_intercept ( & self . fake_scid_rand_bytes , * short_channel_id, & self . genesis_hash ) ) ||
2238
+ fake_scid:: is_valid_phantom ( & self . fake_scid_rand_bytes , * short_channel_id, & self . genesis_hash )
2238
2239
{
2239
2240
None
2240
2241
} else {
@@ -3057,14 +3058,16 @@ impl<M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelManager<M, T, K, F
3057
3058
/// Intercepted HTLCs can be useful for Lightning Service Providers (LSPs) to open a just-in-time
3058
3059
/// channel to a receiving node if the node lacks sufficient inbound liquidity.
3059
3060
///
3060
- /// To make use of intercepted HTLCs, use [`ChannelManager::get_intercept_scid`] to generate short
3061
- /// channel id(s) to put in the receiver's invoice route hints. These route hints will signal to
3062
- /// LDK to generate an [`HTLCIntercepted`] event when it receives the forwarded HTLC, and this
3063
- /// method or [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to the event.
3061
+ /// To make use of intercepted HTLCs, set [`UserConfig::accept_intercept_htlcs`] and use
3062
+ /// [`ChannelManager::get_intercept_scid`] to generate short channel id(s) to put in the
3063
+ /// receiver's invoice route hints. These route hints will signal to LDK to generate an
3064
+ /// [`HTLCIntercepted`] event when it receives the forwarded HTLC, and this method or
3065
+ /// [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to the event.
3064
3066
///
3065
3067
/// Note that LDK does not enforce fee requirements in `amt_to_forward_msat`, and will not stop
3066
3068
/// you from forwarding more than you received.
3067
3069
///
3070
+ /// [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs
3068
3071
/// [`HTLCIntercepted`]: events::Event::HTLCIntercepted
3069
3072
// TODO: when we move to deciding the best outbound channel at forward time, only take
3070
3073
// `next_node_id` and not `next_hop_channel_id`
0 commit comments