Skip to content

Commit 347bb96

Browse files
committed
Test new channel_update re-enabled announcements
1 parent 63377a1 commit 347bb96

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

lightning/src/ln/functional_tests.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7589,6 +7589,7 @@ fn test_announce_disable_channels() {
75897589
for e in msg_events {
75907590
match e {
75917591
MessageSendEvent::BroadcastChannelUpdate { ref msg } => {
7592+
assert_eq!(msg.contents.flags & (1<<1), 1<<1); // The "channel disabled" bit should be set
75927593
let short_id = msg.contents.short_channel_id;
75937594
// Check generated channel_update match list in PendingChannelUpdate
75947595
if short_id != short_id_1 && short_id != short_id_2 && short_id != short_id_3 {
@@ -7624,6 +7625,22 @@ fn test_announce_disable_channels() {
76247625

76257626
nodes[0].node.timer_tick_occurred();
76267627
assert!(nodes[0].node.get_and_clear_pending_msg_events().is_empty());
7628+
nodes[0].node.timer_tick_occurred();
7629+
let msg_events = nodes[0].node.get_and_clear_pending_msg_events();
7630+
assert_eq!(msg_events.len(), 3);
7631+
for e in msg_events {
7632+
match e {
7633+
MessageSendEvent::BroadcastChannelUpdate { ref msg } => {
7634+
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 {
7638+
panic!("Generated ChannelUpdate for wrong chan!");
7639+
}
7640+
},
7641+
_ => panic!("Unexpected event"),
7642+
}
7643+
}
76277644
}
76287645

76297646
#[test]

0 commit comments

Comments
 (0)