@@ -2226,8 +2226,9 @@ impl<M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelManager<M, T, K, F
22262226 None => { // unknown_next_peer
22272227 // Note that this is likely a timing oracle for detecting whether an scid is a
22282228 // phantom or an intercept.
2229- if fake_scid:: is_valid_phantom ( & self . fake_scid_rand_bytes , * short_channel_id, & self . genesis_hash ) ||
2230- fake_scid:: is_valid_intercept ( & self . fake_scid_rand_bytes , * short_channel_id, & self . genesis_hash )
2229+ if ( self . default_configuration . accept_intercept_htlcs &&
2230+ fake_scid:: is_valid_intercept ( & self . fake_scid_rand_bytes , * short_channel_id, & self . genesis_hash ) ) ||
2231+ fake_scid:: is_valid_phantom ( & self . fake_scid_rand_bytes , * short_channel_id, & self . genesis_hash )
22312232 {
22322233 None
22332234 } else {
@@ -3050,14 +3051,16 @@ impl<M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelManager<M, T, K, F
30503051 /// Intercepted HTLCs can be useful for Lightning Service Providers (LSPs) to open a just-in-time
30513052 /// channel to a receiving node if the node lacks sufficient inbound liquidity.
30523053 ///
3053- /// To make use of intercepted HTLCs, use [`ChannelManager::get_intercept_scid`] to generate short
3054- /// channel id(s) to put in the receiver's invoice route hints. These route hints will signal to
3055- /// LDK to generate an [`HTLCIntercepted`] event when it receives the forwarded HTLC, and this
3056- /// method or [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to the event.
3054+ /// To make use of intercepted HTLCs, set [`UserConfig::accept_intercept_htlcs`] and use
3055+ /// [`ChannelManager::get_intercept_scid`] to generate short channel id(s) to put in the
3056+ /// receiver's invoice route hints. These route hints will signal to LDK to generate an
3057+ /// [`HTLCIntercepted`] event when it receives the forwarded HTLC, and this method or
3058+ /// [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to the event.
30573059 ///
30583060 /// Note that LDK does not enforce fee requirements in `amt_to_forward_msat`, and will not stop
30593061 /// you from forwarding more than you received.
30603062 ///
3063+ /// [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs
30613064 /// [`HTLCIntercepted`]: events::Event::HTLCIntercepted
30623065 // TODO: when we move to deciding the best outbound channel at forward time, only take
30633066 // `next_node_id` and not `next_hop_channel_id`
0 commit comments