From 494e3aad9f551da6de319c40ba9ae10c3fa00696 Mon Sep 17 00:00:00 2001 From: Gleb Naumenko Date: Tue, 1 Nov 2022 10:10:49 +0200 Subject: [PATCH] Non-mandatory "fix" enabling future tests --- lightning/src/routing/gossip.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lightning/src/routing/gossip.rs b/lightning/src/routing/gossip.rs index 14df033b6..cf7eb3817 100644 --- a/lightning/src/routing/gossip.rs +++ b/lightning/src/routing/gossip.rs @@ -2532,10 +2532,15 @@ mod tests { assert!(network_graph.update_channel_from_announcement(&valid_channel_announcement, &chain_source).is_ok()); assert!(network_graph.read_only().channels().get(&short_channel_id).is_some()); + // Submit two channel updates for each channel direction (update.flags bit). let valid_channel_update = get_signed_channel_update(|_| {}, node_1_privkey, &secp_ctx); assert!(gossip_sync.handle_channel_update(&valid_channel_update).is_ok()); assert!(network_graph.read_only().channels().get(&short_channel_id).unwrap().one_to_two.is_some()); + let valid_channel_update_2 = get_signed_channel_update(|update| {update.flags |=1;}, node_2_privkey, &secp_ctx); + gossip_sync.handle_channel_update(&valid_channel_update_2).unwrap(); + assert!(network_graph.read_only().channels().get(&short_channel_id).unwrap().two_to_one.is_some()); + network_graph.remove_stale_channels_and_tracking_with_time(100 + STALE_CHANNEL_UPDATE_AGE_LIMIT_SECS); assert_eq!(network_graph.read_only().channels().len(), 1); assert_eq!(network_graph.read_only().nodes().len(), 2); -- 2.39.5