Skip to content

Commit

Permalink
Don't advertise onion messages in known channel features
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinewallace committed Sep 9, 2022
1 parent 444a152 commit 43ae31b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lightning/src/ln/features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}

Expand Down Expand Up @@ -799,6 +802,13 @@ impl<T: sealed::InitialRoutingSync> Features<T> {
}
}

impl<T: sealed::OnionMessages> Features<T> {
pub(crate) fn clear_onion_messages(mut self) -> Self {
<T as sealed::OnionMessages>::clear_bits(&mut self.flags);
self
}
}

impl<T: sealed::ShutdownAnySegwit> Features<T> {
#[cfg(test)]
pub(crate) fn clear_shutdown_anysegwit(mut self) -> Self {
Expand Down

0 comments on commit 43ae31b

Please sign in to comment.