@@ -218,12 +218,6 @@ pub struct ReadOnlyNetworkGraph<'a> {
218218/// [BOLT #4]: https://github.com/lightning/bolts/blob/master/04-onion-routing.md
219219#[ derive( Clone , Debug , PartialEq , Eq ) ]
220220pub enum NetworkUpdate {
221- /// An error indicating a `channel_update` messages should be applied via
222- /// [`NetworkGraph::update_channel`].
223- ChannelUpdateMessage {
224- /// The update to apply via [`NetworkGraph::update_channel`].
225- msg : ChannelUpdate ,
226- } ,
227221 /// An error indicating that a channel failed to route a payment, which should be applied via
228222 /// [`NetworkGraph::channel_failed_permanent`] if permanent.
229223 ChannelFailure {
@@ -245,9 +239,7 @@ pub enum NetworkUpdate {
245239}
246240
247241impl_writeable_tlv_based_enum_upgradable ! ( NetworkUpdate ,
248- ( 0 , ChannelUpdateMessage ) => {
249- ( 0 , msg, required) ,
250- } ,
242+ // 0 was used for channel updates in LDK versions 0.0.123 and below.
251243 ( 2 , ChannelFailure ) => {
252244 ( 0 , short_channel_id, required) ,
253245 ( 2 , is_permanent, required) ,
@@ -354,18 +346,9 @@ where U::Target: UtxoLookup, L::Target: Logger
354346impl < L : Deref > NetworkGraph < L > where L :: Target : Logger {
355347 /// Handles any network updates originating from [`Event`]s.
356348 //
357- /// Note that this will skip applying any [`NetworkUpdate::ChannelUpdateMessage`] to avoid
358- /// leaking possibly identifying information of the sender to the public network.
359- ///
360349 /// [`Event`]: crate::events::Event
361350 pub fn handle_network_update ( & self , network_update : & NetworkUpdate ) {
362351 match * network_update {
363- NetworkUpdate :: ChannelUpdateMessage { ref msg } => {
364- let short_channel_id = msg. contents . short_channel_id ;
365- let is_enabled = msg. contents . flags & ( 1 << 1 ) != ( 1 << 1 ) ;
366- let status = if is_enabled { "enabled" } else { "disabled" } ;
367- log_debug ! ( self . logger, "Skipping application of a channel update from a payment failure. Channel {} is {}." , short_channel_id, status) ;
368- } ,
369352 NetworkUpdate :: ChannelFailure { short_channel_id, is_permanent } => {
370353 if is_permanent {
371354 log_debug ! ( self . logger, "Removing channel graph entry for {} due to a payment failure." , short_channel_id) ;
@@ -2575,23 +2558,18 @@ pub(crate) mod tests {
25752558
25762559 let short_channel_id;
25772560 {
2578- // Check we won't apply an update via `handle_network_update` for privacy reasons, but
2579- // can continue fine if we manually apply it.
2561+ // Check that we can manually apply a channel update.
25802562 let valid_channel_announcement = get_signed_channel_announcement ( |_| { } , node_1_privkey, node_2_privkey, & secp_ctx) ;
25812563 short_channel_id = valid_channel_announcement. contents . short_channel_id ;
25822564 let chain_source: Option < & test_utils:: TestChainSource > = None ;
25832565 assert ! ( network_graph. update_channel_from_announcement( & valid_channel_announcement, & chain_source) . is_ok( ) ) ;
25842566 assert ! ( network_graph. read_only( ) . channels( ) . get( & short_channel_id) . is_some( ) ) ;
25852567
25862568 let valid_channel_update = get_signed_channel_update ( |_| { } , node_1_privkey, & secp_ctx) ;
2587- assert ! ( network_graph. read_only( ) . channels( ) . get( & short_channel_id) . unwrap( ) . one_to_two. is_none( ) ) ;
2588-
2589- network_graph. handle_network_update ( & NetworkUpdate :: ChannelUpdateMessage {
2590- msg : valid_channel_update. clone ( ) ,
2591- } ) ;
25922569
25932570 assert ! ( network_graph. read_only( ) . channels( ) . get( & short_channel_id) . unwrap( ) . one_to_two. is_none( ) ) ;
25942571 network_graph. update_channel ( & valid_channel_update) . unwrap ( ) ;
2572+ assert ! ( network_graph. read_only( ) . channels( ) . get( & short_channel_id) . unwrap( ) . one_to_two. is_some( ) ) ;
25952573 }
25962574
25972575 // Non-permanent failure doesn't touch the channel at all
0 commit comments