nodes[0].node.timer_tick_occurred(); // DisabledStaged -> Disabled
let msg_events = nodes[0].node.get_and_clear_pending_msg_events();
assert_eq!(msg_events.len(), 3);
+ let mut chans_disabled: HashSet<u64> = [short_id_1, short_id_2, short_id_3].iter().map(|a| *a).collect();
for e in msg_events {
match e {
MessageSendEvent::BroadcastChannelUpdate { ref msg } => {
assert_eq!(msg.contents.flags & (1<<1), 1<<1); // The "channel disabled" bit should be set
- let short_id = msg.contents.short_channel_id;
- // Check generated channel_update match list in PendingChannelUpdate
- if short_id != short_id_1 && short_id != short_id_2 && short_id != short_id_3 {
+ // Check that each channel gets updated exactly once
+ if !chans_disabled.remove(&msg.contents.short_channel_id) {
panic!("Generated ChannelUpdate for wrong chan!");
}
},
nodes[0].node.timer_tick_occurred();
let msg_events = nodes[0].node.get_and_clear_pending_msg_events();
assert_eq!(msg_events.len(), 3);
+ chans_disabled = [short_id_1, short_id_2, short_id_3].iter().map(|a| *a).collect();
for e in msg_events {
match e {
MessageSendEvent::BroadcastChannelUpdate { ref msg } => {
assert_eq!(msg.contents.flags & (1<<1), 0); // The "channel disabled" bit should be off
- let short_id = msg.contents.short_channel_id;
- // Check generated channel_update match list in PendingChannelUpdate
- if short_id != short_id_1 && short_id != short_id_2 && short_id != short_id_3 {
+ // Check that each channel gets updated exactly once
+ if !chans_disabled.remove(&msg.contents.short_channel_id) {
panic!("Generated ChannelUpdate for wrong chan!");
}
},