@@ -2531,32 +2531,6 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
2531
2531
let pending_msg_events = & mut channel_state. pending_msg_events ;
2532
2532
let short_to_id = & mut channel_state. short_to_id ;
2533
2533
channel_state. by_id . retain ( |chan_id, chan| {
2534
- match chan. channel_update_status ( ) {
2535
- ChannelUpdateStatus :: Enabled if !chan. is_live ( ) => chan. set_channel_update_status ( ChannelUpdateStatus :: DisabledStaged ) ,
2536
- ChannelUpdateStatus :: Disabled if chan. is_live ( ) => chan. set_channel_update_status ( ChannelUpdateStatus :: EnabledStaged ) ,
2537
- ChannelUpdateStatus :: DisabledStaged if chan. is_live ( ) => chan. set_channel_update_status ( ChannelUpdateStatus :: Enabled ) ,
2538
- ChannelUpdateStatus :: EnabledStaged if !chan. is_live ( ) => chan. set_channel_update_status ( ChannelUpdateStatus :: Disabled ) ,
2539
- ChannelUpdateStatus :: DisabledStaged if !chan. is_live ( ) => {
2540
- if let Ok ( update) = self . get_channel_update_for_broadcast ( & chan) {
2541
- pending_msg_events. push ( events:: MessageSendEvent :: BroadcastChannelUpdate {
2542
- msg : update
2543
- } ) ;
2544
- }
2545
- should_persist = NotifyOption :: DoPersist ;
2546
- chan. set_channel_update_status ( ChannelUpdateStatus :: Disabled ) ;
2547
- } ,
2548
- ChannelUpdateStatus :: EnabledStaged if chan. is_live ( ) => {
2549
- if let Ok ( update) = self . get_channel_update_for_broadcast ( & chan) {
2550
- pending_msg_events. push ( events:: MessageSendEvent :: BroadcastChannelUpdate {
2551
- msg : update
2552
- } ) ;
2553
- }
2554
- should_persist = NotifyOption :: DoPersist ;
2555
- chan. set_channel_update_status ( ChannelUpdateStatus :: Enabled ) ;
2556
- } ,
2557
- _ => { } ,
2558
- }
2559
-
2560
2534
let counterparty_node_id = chan. get_counterparty_node_id ( ) ;
2561
2535
let ( mut retain_channel, chan_needs_persist, err) = self . update_channel_fee ( short_to_id, pending_msg_events, chan_id, chan, new_feerate) ;
2562
2536
if chan_needs_persist == NotifyOption :: DoPersist { should_persist = NotifyOption :: DoPersist ; }
@@ -2572,6 +2546,34 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
2572
2546
}
2573
2547
}
2574
2548
2549
+ if retain_channel {
2550
+ match chan. channel_update_status ( ) {
2551
+ ChannelUpdateStatus :: Enabled if !chan. is_live ( ) => chan. set_channel_update_status ( ChannelUpdateStatus :: DisabledStaged ) ,
2552
+ ChannelUpdateStatus :: Disabled if chan. is_live ( ) => chan. set_channel_update_status ( ChannelUpdateStatus :: EnabledStaged ) ,
2553
+ ChannelUpdateStatus :: DisabledStaged if chan. is_live ( ) => chan. set_channel_update_status ( ChannelUpdateStatus :: Enabled ) ,
2554
+ ChannelUpdateStatus :: EnabledStaged if !chan. is_live ( ) => chan. set_channel_update_status ( ChannelUpdateStatus :: Disabled ) ,
2555
+ ChannelUpdateStatus :: DisabledStaged if !chan. is_live ( ) => {
2556
+ if let Ok ( update) = self . get_channel_update_for_broadcast ( & chan) {
2557
+ pending_msg_events. push ( events:: MessageSendEvent :: BroadcastChannelUpdate {
2558
+ msg : update
2559
+ } ) ;
2560
+ }
2561
+ should_persist = NotifyOption :: DoPersist ;
2562
+ chan. set_channel_update_status ( ChannelUpdateStatus :: Disabled ) ;
2563
+ } ,
2564
+ ChannelUpdateStatus :: EnabledStaged if chan. is_live ( ) => {
2565
+ if let Ok ( update) = self . get_channel_update_for_broadcast ( & chan) {
2566
+ pending_msg_events. push ( events:: MessageSendEvent :: BroadcastChannelUpdate {
2567
+ msg : update
2568
+ } ) ;
2569
+ }
2570
+ should_persist = NotifyOption :: DoPersist ;
2571
+ chan. set_channel_update_status ( ChannelUpdateStatus :: Enabled ) ;
2572
+ } ,
2573
+ _ => { } ,
2574
+ }
2575
+ }
2576
+
2575
2577
retain_channel
2576
2578
} ) ;
2577
2579
}
0 commit comments