Skip to content

Commit 5a2350b

Browse files
Don't advertise onion messages in known channel features
1 parent d5253bf commit 5a2350b

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

lightning/src/ln/features.rs

+11-1
Original file line numberDiff line numberDiff line change
@@ -559,13 +559,16 @@ impl InitFeatures {
559559
Self::known()
560560
.clear_initial_routing_sync()
561561
.clear_gossip_queries()
562+
.clear_onion_messages()
562563
}
563564
}
564565

565566
impl NodeFeatures {
566567
/// Returns the set of known node features that are related to channels.
567568
pub fn known_channel_features() -> NodeFeatures {
568-
Self::known().clear_gossip_queries()
569+
Self::known()
570+
.clear_gossip_queries()
571+
.clear_onion_messages()
569572
}
570573
}
571574

@@ -799,6 +802,13 @@ impl<T: sealed::InitialRoutingSync> Features<T> {
799802
}
800803
}
801804

805+
impl<T: sealed::OnionMessages> Features<T> {
806+
pub(crate) fn clear_onion_messages(mut self) -> Self {
807+
<T as sealed::OnionMessages>::clear_bits(&mut self.flags);
808+
self
809+
}
810+
}
811+
802812
impl<T: sealed::ShutdownAnySegwit> Features<T> {
803813
#[cfg(test)]
804814
pub(crate) fn clear_shutdown_anysegwit(mut self) -> Self {

0 commit comments

Comments
 (0)