Signal `GossipQuery` support when using `IgnoringMessagHandler`
authorElias Rohrer <dev@tnull.de>
Thu, 21 Mar 2024 07:51:10 +0000 (08:51 +0100)
committerElias Rohrer <dev@tnull.de>
Thu, 21 Mar 2024 08:05:05 +0000 (09:05 +0100)
With its v24.02 release CLN made `GossipQueries` a required feature,
leading to a incompatibility between LDK and CLN when using
`IgnoringMessagHandler` as a `RoutingMessageHandler`, which is usually
the case when a node uses RGS.

To fix this issue, we let `IgnoringMessagHandler` signal `GossipQuery`
support, just to go ahead and ignore every gossip message the peer will
send us. While this is nonsensical and still might result in some
unnecessary bandwidth wasted, we have to do something to fix the
incompatibility.

lightning/src/ln/peer_handler.rs

index 11cdd906abad191ec163c7b0a55766b3101fb223..535f9a48667091a86d8c433449bd5e7a439f645d 100644 (file)
@@ -116,7 +116,9 @@ impl RoutingMessageHandler for IgnoringMessageHandler {
        fn handle_query_short_channel_ids(&self, _their_node_id: &PublicKey, _msg: msgs::QueryShortChannelIds) -> Result<(), LightningError> { Ok(()) }
        fn provided_node_features(&self) -> NodeFeatures { NodeFeatures::empty() }
        fn provided_init_features(&self, _their_node_id: &PublicKey) -> InitFeatures {
-               InitFeatures::empty()
+               let mut features = InitFeatures::empty();
+               features.set_gossip_queries_optional();
+               features
        }
        fn processing_queue_high(&self) -> bool { false }
 }