Skip to content

Commit

Permalink
WIP: experimentation stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
arik-so committed Nov 21, 2024
1 parent 06c11bb commit bcfab4b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lightning/src/ln/onion_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -560,10 +560,9 @@ pub(super) fn construct_trampoline_onion_packet(
.map(|p| {
let mut payload_len = LengthCalculatingWriter(0);
p.write(&mut payload_len).expect("Failed to calculate length");
payload_len.0.checked_add(32).expect("Excessive payload size")
payload_len.0.checked_add(32)
})
.try_fold(0usize, |a, b| a.checked_add(b))
.expect("Excessive onion length");
.try_fold(0usize, |a, b| b.map(|b| b.checked_add(a)));

assert!(
minimum_packet_length < ONION_DATA_LEN,
Expand Down

0 comments on commit bcfab4b

Please sign in to comment.