diff --git a/lightning/src/routing/gossip.rs b/lightning/src/routing/gossip.rs index 5009f3a3c5b..607f8c22eff 100644 --- a/lightning/src/routing/gossip.rs +++ b/lightning/src/routing/gossip.rs @@ -2333,29 +2333,26 @@ impl NetworkGraph where L::Target: Logger { if let Some(channel) = channels.get_mut(&msg.short_channel_id) { check_msg_sanity(channel)?; - let get_new_channel_info = || { - let last_update_message = if msg.excess_data.len() <= MAX_EXCESS_BYTES_FOR_RELAY - { full_msg.cloned() } else { None }; - - let updated_channel_update_info = ChannelUpdateInfo { - enabled: chan_enabled, - last_update: msg.timestamp, - cltv_expiry_delta: msg.cltv_expiry_delta, - htlc_minimum_msat: msg.htlc_minimum_msat, - htlc_maximum_msat: msg.htlc_maximum_msat, - fees: RoutingFees { - base_msat: msg.fee_base_msat, - proportional_millionths: msg.fee_proportional_millionths, - }, - last_update_message - }; - Some(updated_channel_update_info) - }; + let last_update_message = if msg.excess_data.len() <= MAX_EXCESS_BYTES_FOR_RELAY + { full_msg.cloned() } else { None }; + + let new_channel_info = Some(ChannelUpdateInfo { + enabled: chan_enabled, + last_update: msg.timestamp, + cltv_expiry_delta: msg.cltv_expiry_delta, + htlc_minimum_msat: msg.htlc_minimum_msat, + htlc_maximum_msat: msg.htlc_maximum_msat, + fees: RoutingFees { + base_msat: msg.fee_base_msat, + proportional_millionths: msg.fee_proportional_millionths, + }, + last_update_message + }); if msg.channel_flags & 1 == 1 { - channel.two_to_one = get_new_channel_info(); + channel.two_to_one = new_channel_info; } else { - channel.one_to_two = get_new_channel_info(); + channel.one_to_two = new_channel_info; } }