Don't advertise onion messages in known channel features

This commit is contained in:
Valentine Wallace 2022-09-09 12:41:23 -04:00
parent 90f5906082
commit 9c3b6d2edd
No known key found for this signature in database
GPG key ID: FD3E106A2CE099B4

View file

@ -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<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 {