Skip to content

Commit

Permalink
f: Cleanup max_length calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
shaavan committed Jul 23, 2024
1 parent df06f55 commit 55262b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lightning/src/blinded_path/payment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,8 @@ pub(super) fn blinded_hops<T: secp256k1::Signing + secp256k1::Verification>(
.chain(core::iter::once(BlindedPaymentTlvsRef::Receive(&payee_tlvs)));

let max_length = tlvs.clone()
.max_by_key(|c| c.serialized_length())
.map(|c| c.serialized_length())
.map(|tlv| tlv.serialized_length())
.max()
.unwrap_or(0);

let length_tlvs = tlvs.map(|tlv| (max_length, tlv));
Expand Down

0 comments on commit 55262b7

Please sign in to comment.