We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5571499 commit 077b718Copy full SHA for 077b718
lightning/src/blinded_path/mod.rs
@@ -258,14 +258,9 @@ impl Direction {
258
259
/// Returns the [`PublicKey`] from the inputs corresponding to the direction.
260
pub fn select_pubkey<'a>(&self, node_a: &'a PublicKey, node_b: &'a PublicKey) -> &'a PublicKey {
261
- let (node_one, node_two) = if node_a < node_b {
262
- (node_a, node_b)
263
- } else {
264
- (node_b, node_a)
265
- };
266
match self {
267
- Direction::NodeOne => node_one,
268
- Direction::NodeTwo => node_two,
+ Direction::NodeOne => core::cmp::min(node_a, node_b),
+ Direction::NodeTwo => core::cmp::max(node_a, node_b)
269
}
270
271
0 commit comments