From 9c3b6d2edd1dc33ef53a8b79ed27db20fd89135e Mon Sep 17 00:00:00 2001 From: Valentine Wallace Date: Fri, 9 Sep 2022 12:41:23 -0400 Subject: [PATCH] Don't advertise onion messages in known channel features --- lightning/src/ln/features.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lightning/src/ln/features.rs b/lightning/src/ln/features.rs index 34dd28337..642298f56 100644 --- a/lightning/src/ln/features.rs +++ b/lightning/src/ln/features.rs @@ -559,13 +559,16 @@ impl InitFeatures { Self::known() .clear_initial_routing_sync() .clear_gossip_queries() + .clear_onion_messages() } } impl NodeFeatures { /// Returns the set of known node features that are related to channels. pub fn known_channel_features() -> NodeFeatures { - Self::known().clear_gossip_queries() + Self::known() + .clear_gossip_queries() + .clear_onion_messages() } } @@ -799,6 +802,13 @@ impl Features { } } +impl Features { + pub(crate) fn clear_onion_messages(mut self) -> Self { + ::clear_bits(&mut self.flags); + self + } +} + impl Features { #[cfg(test)] pub(crate) fn clear_shutdown_anysegwit(mut self) -> Self { -- 2.39.5