Skip to content

Commit 50444ea

Browse files
Don't advertise onion messages in known channel features
1 parent ec76826 commit 50444ea

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,14 +559,17 @@ 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. At least some of
567568
/// these features are likely required for peers to talk to us.
568569
pub fn known_channel_features() -> NodeFeatures {
569-
Self::known().clear_gossip_queries()
570+
Self::known()
571+
.clear_gossip_queries()
572+
.clear_onion_messages()
570573
}
571574
}
572575

@@ -800,6 +803,13 @@ impl<T: sealed::InitialRoutingSync> Features<T> {
800803
}
801804
}
802805

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

0 commit comments

Comments
 (0)