Skip to content

Commit

Permalink
Merge pull request #2640 from sr-gi/20231003-expose-from-be-bytes
Browse files Browse the repository at this point in the history
Makes Features::from_be_bytes public
  • Loading branch information
TheBlueMatt authored Oct 5, 2023
2 parents 9de51f0 + 2b1d693 commit eea19de
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lightning/src/ln/features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit eea19de

Please sign in to comment.