@@ -2233,8 +2233,9 @@ impl<M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelManager<M, T, K, F
22332233 None => { // unknown_next_peer
22342234 // Note that this is likely a timing oracle for detecting whether an scid is a
22352235 // 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 )
22382239 {
22392240 None
22402241 } else {
@@ -3057,14 +3058,16 @@ impl<M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelManager<M, T, K, F
30573058 /// Intercepted HTLCs can be useful for Lightning Service Providers (LSPs) to open a just-in-time
30583059 /// channel to a receiving node if the node lacks sufficient inbound liquidity.
30593060 ///
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.
30643066 ///
30653067 /// Note that LDK does not enforce fee requirements in `amt_to_forward_msat`, and will not stop
30663068 /// you from forwarding more than you received.
30673069 ///
3070+ /// [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs
30683071 /// [`HTLCIntercepted`]: events::Event::HTLCIntercepted
30693072 // TODO: when we move to deciding the best outbound channel at forward time, only take
30703073 // `next_node_id` and not `next_hop_channel_id`
0 commit comments