From: Sergi Delgado Segura Date: Tue, 3 Oct 2023 12:46:18 +0000 (-0400) Subject: Makes Features::from_be_bytes public X-Git-Tag: v0.0.118~26^2 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=2b1d6937a8c027cdf3786eb8617032b2e5d65d11;p=rust-lightning Makes Features::from_be_bytes public Downstream projects building Feature are most likely doing so with a big-endian byte array, however only `from_le_bytes` is exposed. --- diff --git a/lightning/src/ln/features.rs b/lightning/src/ln/features.rs index bcaa91ab2..d10c3a719 100644 --- a/lightning/src/ln/features.rs +++ b/lightning/src/ln/features.rs @@ -718,7 +718,11 @@ impl Features { Ok(()) } - fn from_be_bytes(mut flags: Vec) -> Features { + /// 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) -> Features { flags.reverse(); // Swap to little-endian Self { flags,