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 06c11bb commit bcfab4bCopy full SHA for bcfab4b
lightning/src/ln/onion_utils.rs
@@ -560,10 +560,9 @@ pub(super) fn construct_trampoline_onion_packet(
560
.map(|p| {
561
let mut payload_len = LengthCalculatingWriter(0);
562
p.write(&mut payload_len).expect("Failed to calculate length");
563
- payload_len.0.checked_add(32).expect("Excessive payload size")
+ payload_len.0.checked_add(32)
564
})
565
- .try_fold(0usize, |a, b| a.checked_add(b))
566
- .expect("Excessive onion length");
+ .try_fold(0usize, |a, b| b.map(|b| b.checked_add(a)));
567
568
assert!(
569
minimum_packet_length < ONION_DATA_LEN,
0 commit comments