Skip to content

Commit f12051f

Browse files
committed
WIP: experimentation stuff
1 parent 53caf6f commit f12051f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lightning/src/ln/onion_utils.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -425,10 +425,9 @@ pub(super) fn construct_trampoline_onion_packet(
425425
.map(|p| {
426426
let mut payload_len = LengthCalculatingWriter(0);
427427
p.write(&mut payload_len).expect("Failed to calculate length");
428-
payload_len.0.checked_add(32).expect("Excessive payload size")
428+
payload_len.0.checked_add(32)
429429
})
430-
.try_fold(0usize, |a, b| a.checked_add(b))
431-
.expect("Excessive onion length");
430+
.try_fold(0usize, |a, b| b.map(|b| b.checked_add(a)));
432431

433432
assert!(
434433
minimum_packet_length < ONION_DATA_LEN,

0 commit comments

Comments
 (0)