Skip to content

Commit

Permalink
Merge pull request #209 from bjohnson5/208-feature-bits-fix
Browse files Browse the repository at this point in the history
Fixing the CLN feature bit parsing
  • Loading branch information
carlaKC authored Dec 18, 2024
2 parents 4d33f24 + 5f802c9 commit 8834888
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions simln-lib/src/cln.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ impl ClnNode {
connection.id.validate(&pubkey, &mut alias)?;

let features = if let Some(features) = our_features {
NodeFeatures::from_le_bytes(features.node)
NodeFeatures::from_be_bytes(features.node)
} else {
NodeFeatures::empty()
};
Expand Down Expand Up @@ -248,11 +248,7 @@ impl LightningNode for ClnNode {
features: node
.features
.clone()
.map_or(NodeFeatures::empty(), |mut f| {
// We need to reverse this given it has the CLN wire encoding which is BE
f.reverse();
NodeFeatures::from_le_bytes(f)
}),
.map_or(NodeFeatures::empty(), NodeFeatures::from_be_bytes),
})
} else {
Err(LightningError::GetNodeInfoError(
Expand Down

0 comments on commit 8834888

Please sign in to comment.