Skip to content

Commit 649ba34

Browse files
committed
f describe why two bytes is the minimum padding
1 parent 9b23f6e commit 649ba34

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lightning/src/blinded_path/message.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -767,8 +767,9 @@ pub(super) fn blinded_hops<T: secp256k1::Signing + secp256k1::Verification>(
767767
intermediate_tlvs.clone().any(|tlvs| tlvs.serialized_length() == max_intermediate_len - 1);
768768

769769
let round_off = if compact_padding {
770-
// We can only pad by a minimum of two bytes. Thus, if there are any intermediate hops that
771-
// need to be padded by exactly one byte, we have to instead pad everything by two.
770+
// We can only pad by a minimum of two bytes (we can only go from no-TLV to a type + length
771+
// byte). Thus, if there are any intermediate hops that need to be padded by exactly one
772+
// byte, we have to instead pad everything by two.
772773
if have_intermediate_one_byte_smaller {
773774
max_intermediate_len + 2
774775
} else {

0 commit comments

Comments
 (0)