File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
lightning/src/blinded_path Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,7 @@ impl BlindedPath {
9898 found_recv_payload = true ;
9999 } else if found_recv_payload { return Err ( ( ) ) }
100100 }
101+ if !found_recv_payload { return Err ( ( ) ) }
101102
102103 let blinding_secret_bytes = entropy_source. get_secure_random_bytes ( ) ;
103104 let blinding_secret = SecretKey :: from_slice ( & blinding_secret_bytes[ ..] ) . expect ( "RNG is busted" ) ;
Original file line number Diff line number Diff line change @@ -312,5 +312,20 @@ mod tests {
312312 } ,
313313 } ) ] ;
314314 assert ! ( BlindedPath :: new_for_payment( & multiple_recv_payloads_path[ ..] , & keys_manager, & secp_ctx) . is_err( ) ) ;
315+
316+ let missing_recv_payload_path = vec ! [ ( dummy_pk, BlindedPaymentTlvs :: Forward {
317+ short_channel_id: 0 ,
318+ payment_relay: PaymentRelay {
319+ cltv_expiry_delta: 144 ,
320+ fee_proportional_millionths: 500 ,
321+ fee_base_msat: 100 ,
322+ } ,
323+ payment_constraints: PaymentConstraints {
324+ max_cltv_expiry: 0 ,
325+ htlc_minimum_msat: 100 ,
326+ } ,
327+ features: BlindedHopFeatures :: empty( ) ,
328+ } ) ] ;
329+ assert ! ( BlindedPath :: new_for_payment( & missing_recv_payload_path[ ..] , & keys_manager, & secp_ctx) . is_err( ) ) ;
315330 }
316331}
You can’t perform that action at this time.
0 commit comments