From 2b1d6937a8c027cdf3786eb8617032b2e5d65d11 Mon Sep 17 00:00:00 2001 From: Sergi Delgado Segura Date: Tue, 3 Oct 2023 08:46:18 -0400 Subject: [PATCH] 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. --- lightning/src/ln/features.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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, -- 2.39.5