Merge pull request #2640 from sr-gi/20231003-expose-from-be-bytes
authorMatt Corallo <649246+TheBlueMatt@users.noreply.github.com>
Thu, 5 Oct 2023 23:45:59 +0000 (23:45 +0000)
committerGitHub <noreply@github.com>
Thu, 5 Oct 2023 23:45:59 +0000 (23:45 +0000)
Makes Features::from_be_bytes public

lightning/src/ln/features.rs

index bcaa91ab266fe7f10ebbc8de710fc30d927365c3..d10c3a71927b254854fd11869f1d9cbaedf7cb35 100644 (file)
@@ -718,7 +718,11 @@ impl<T: sealed::Context> Features<T> {
                Ok(())
        }
 
-       fn from_be_bytes(mut flags: Vec<u8>) -> Features<T> {
+       /// Create a [`Features`] given a set of flags, in big-endian. This is in byte order from
+       /// most on-the-wire encodings.
+       ///
+       /// This is not exported to bindings users as we don't support export across multiple T
+       pub fn from_be_bytes(mut flags: Vec<u8>) -> Features<T> {
                flags.reverse(); // Swap to little-endian
                Self {
                        flags,