Stop relying on `*Features::known` in functional test utils
[rust-lightning] / lightning / src / ln / features.rs
index 34dd28337215e1413f557a8ed1dc0e4497d180a3..9509f0f23bf6e1c5e7a5d0c66da2a7e3c8bdc58b 100644 (file)
@@ -168,9 +168,6 @@ mod sealed {
                        ,
                ],
                optional_features: [
-                       // Note that if new "non-channel-related" flags are added here they should be
-                       // explicitly cleared in InitFeatures::known_channel_features and
-                       // NodeFeatures::known_channel_features.
                        // Byte 0
                        DataLossProtect | InitialRoutingSync | UpfrontShutdownScript | GossipQueries,
                        // Byte 1
@@ -552,21 +549,6 @@ impl InitFeatures {
        pub(crate) fn to_context<C: sealed::Context>(&self) -> Features<C> {
                self.to_context_internal()
        }
-
-       /// Returns the set of known init features that are related to channels. At least some of
-       /// these features are likely required for peers to talk to us.
-       pub fn known_channel_features() -> InitFeatures {
-               Self::known()
-                       .clear_initial_routing_sync()
-                       .clear_gossip_queries()
-       }
-}
-
-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()
-       }
 }
 
 impl InvoiceFeatures {
@@ -785,6 +767,7 @@ impl<T: sealed::UpfrontShutdownScript> Features<T> {
 
 
 impl<T: sealed::GossipQueries> Features<T> {
+       #[cfg(test)]
        pub(crate) fn clear_gossip_queries(mut self) -> Self {
                <T as sealed::GossipQueries>::clear_bits(&mut self.flags);
                self
@@ -793,6 +776,7 @@ impl<T: sealed::GossipQueries> Features<T> {
 
 impl<T: sealed::InitialRoutingSync> Features<T> {
        // Note that initial_routing_sync is ignored if gossip_queries is set.
+       #[cfg(test)]
        pub(crate) fn clear_initial_routing_sync(mut self) -> Self {
                <T as sealed::InitialRoutingSync>::clear_bits(&mut self.flags);
                self