File tree 1 file changed +1
-8
lines changed
lightning/src/blinded_path
1 file changed +1
-8
lines changed Original file line number Diff line number Diff line change @@ -233,14 +233,7 @@ impl<T:Writeable> Writeable for BlindedPathWithPadding<T> {
233
233
#[ cfg( test) ]
234
234
/// Checks if all the packets in the blinded path are properly padded.
235
235
pub fn is_padded ( hops : & [ BlindedHop ] , padding_round_off : usize ) -> bool {
236
- let first_hop = hops. first ( ) . expect ( "BlindedPath must have at least one hop" ) ;
237
- let first_payload_size = first_hop. encrypted_payload . len ( ) ;
238
-
239
- // The unencrypted payload data is padded before getting encrypted.
240
- // Assuming the first payload is padded properly, get the extra data length.
241
- let extra_length = first_payload_size % padding_round_off;
242
236
hops. iter ( ) . all ( |hop| {
243
- // Check that every packet is padded to the round off length subtracting the extra length.
244
- ( hop. encrypted_payload . len ( ) - extra_length) % padding_round_off == 0
237
+ hop. encrypted_payload . len ( ) % padding_round_off == 0
245
238
} )
246
239
}
You can’t perform that action at this time.
0 commit comments