@@ -7586,13 +7586,13 @@ fn test_announce_disable_channels() {
7586
7586
nodes[ 0 ] . node . timer_tick_occurred ( ) ; // DisabledStaged -> Disabled
7587
7587
let msg_events = nodes[ 0 ] . node . get_and_clear_pending_msg_events ( ) ;
7588
7588
assert_eq ! ( msg_events. len( ) , 3 ) ;
7589
+ let mut chans_disabled: HashSet < u64 > = [ short_id_1, short_id_2, short_id_3] . iter ( ) . map ( |a| * a) . collect ( ) ;
7589
7590
for e in msg_events {
7590
7591
match e {
7591
7592
MessageSendEvent :: BroadcastChannelUpdate { ref msg } => {
7592
7593
assert_eq ! ( msg. contents. flags & ( 1 <<1 ) , 1 <<1 ) ; // The "channel disabled" bit should be set
7593
- let short_id = msg. contents . short_channel_id ;
7594
- // Check generated channel_update match list in PendingChannelUpdate
7595
- if short_id != short_id_1 && short_id != short_id_2 && short_id != short_id_3 {
7594
+ // Check that each channel gets updated exactly once
7595
+ if !chans_disabled. remove ( & msg. contents . short_channel_id ) {
7596
7596
panic ! ( "Generated ChannelUpdate for wrong chan!" ) ;
7597
7597
}
7598
7598
} ,
@@ -7628,13 +7628,13 @@ fn test_announce_disable_channels() {
7628
7628
nodes[ 0 ] . node . timer_tick_occurred ( ) ;
7629
7629
let msg_events = nodes[ 0 ] . node . get_and_clear_pending_msg_events ( ) ;
7630
7630
assert_eq ! ( msg_events. len( ) , 3 ) ;
7631
+ chans_disabled = [ short_id_1, short_id_2, short_id_3] . iter ( ) . map ( |a| * a) . collect ( ) ;
7631
7632
for e in msg_events {
7632
7633
match e {
7633
7634
MessageSendEvent :: BroadcastChannelUpdate { ref msg } => {
7634
7635
assert_eq ! ( msg. contents. flags & ( 1 <<1 ) , 0 ) ; // The "channel disabled" bit should be off
7635
- let short_id = msg. contents . short_channel_id ;
7636
- // Check generated channel_update match list in PendingChannelUpdate
7637
- if short_id != short_id_1 && short_id != short_id_2 && short_id != short_id_3 {
7636
+ // Check that each channel gets updated exactly once
7637
+ if !chans_disabled. remove ( & msg. contents . short_channel_id ) {
7638
7638
panic ! ( "Generated ChannelUpdate for wrong chan!" ) ;
7639
7639
}
7640
7640
} ,
0 commit comments