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 53caf6f commit f12051fCopy full SHA for f12051f
lightning/src/ln/onion_utils.rs
@@ -425,10 +425,9 @@ pub(super) fn construct_trampoline_onion_packet(
425
.map(|p| {
426
let mut payload_len = LengthCalculatingWriter(0);
427
p.write(&mut payload_len).expect("Failed to calculate length");
428
- payload_len.0.checked_add(32).expect("Excessive payload size")
+ payload_len.0.checked_add(32)
429
})
430
- .try_fold(0usize, |a, b| a.checked_add(b))
431
- .expect("Excessive onion length");
+ .try_fold(0usize, |a, b| b.map(|b| b.checked_add(a)));
432
433
assert!(
434
minimum_packet_length < ONION_DATA_LEN,
0 commit comments