File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -4396,8 +4396,18 @@ mod tests {
4396
4396
assert_eq ! ( route. paths. len( ) , 3 ) ;
4397
4397
let mut total_amount_paid_msat = 0 ;
4398
4398
for path in & route. paths {
4399
+ if payment_params. payee . blinded_route_hints ( ) . len ( ) != 0 {
4400
+ assert ! ( path. blinded_tail. is_some( ) ) } else { assert ! ( path. blinded_tail. is_none( ) ) }
4399
4401
if let Some ( bt) = & path. blinded_tail {
4400
4402
assert_eq ! ( path. hops. len( ) + if bt. hops. len( ) == 1 { 0 } else { 1 } , 2 ) ;
4403
+ if bt. hops . len ( ) > 1 {
4404
+ assert_eq ! ( path. hops. last( ) . unwrap( ) . pubkey,
4405
+ payment_params. payee. blinded_route_hints( ) . iter( )
4406
+ . find( |( p, _) | p. htlc_maximum_msat == path. final_value_msat( ) )
4407
+ . map( |( _, p) | p. introduction_node_id) . unwrap( ) ) ;
4408
+ } else {
4409
+ assert_eq ! ( path. hops. last( ) . unwrap( ) . pubkey, nodes[ 2 ] ) ;
4410
+ }
4401
4411
} else {
4402
4412
assert_eq ! ( path. hops. len( ) , 2 ) ;
4403
4413
assert_eq ! ( path. hops. last( ) . unwrap( ) . pubkey, nodes[ 2 ] ) ;
You can’t perform that action at this time.
0 commit comments