Skip to content

Commit 2b1d693

Browse files
committed
Makes Features::from_be_bytes public
Downstream projects building Feature<T> are most likely doing so with a big-endian byte array, however only `from_le_bytes` is exposed.
1 parent 9b1b724 commit 2b1d693

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lightning/src/ln/features.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,11 @@ impl<T: sealed::Context> Features<T> {
718718
Ok(())
719719
}
720720

721-
fn from_be_bytes(mut flags: Vec<u8>) -> Features<T> {
721+
/// Create a [`Features`] given a set of flags, in big-endian. This is in byte order from
722+
/// most on-the-wire encodings.
723+
///
724+
/// This is not exported to bindings users as we don't support export across multiple T
725+
pub fn from_be_bytes(mut flags: Vec<u8>) -> Features<T> {
722726
flags.reverse(); // Swap to little-endian
723727
Self {
724728
flags,

0 commit comments

Comments
 (0)