+ let route = if check == ReceiveCheckFail::ProcessPendingHTLCsCheck {
+ let mut route = get_route(&nodes[0], &route_params).unwrap();
+ // Set the final CLTV expiry too low to trigger the failure in process_pending_htlc_forwards.
+ route.paths[0].blinded_tail.as_mut().map(|bt| bt.excess_final_cltv_expiry_delta = TEST_FINAL_CLTV - 2);
+ route
+ } else if check == ReceiveCheckFail::PaymentConstraints {
+ // Create a blinded path where the receiver's encrypted payload has an htlc_minimum_msat that is
+ // violated by `amt_msat`, and stick it in the route_params without changing the corresponding
+ // BlindedPayInfo (to ensure pathfinding still succeeds).
+ let high_htlc_min_bp = {
+ let mut high_htlc_minimum_upd = chan_upd_1_2.clone();
+ high_htlc_minimum_upd.htlc_minimum_msat = amt_msat + 1000;
+ let high_htlc_min_params = get_blinded_route_parameters(amt_msat, payment_secret,
+ nodes.iter().skip(1).map(|n| n.node.get_our_node_id()).collect(), &[&high_htlc_minimum_upd],
+ &chanmon_cfgs[2].keys_manager);
+ if let Payee::Blinded { route_hints, .. } = high_htlc_min_params.payment_params.payee {
+ route_hints[0].1.clone()
+ } else { panic!() }
+ };
+ if let Payee::Blinded { ref mut route_hints, .. } = route_params.payment_params.payee {
+ route_hints[0].1 = high_htlc_min_bp;
+ } else { panic!() }
+ find_route(&nodes[0], &route_params).unwrap()
+ } else {
+ find_route(&nodes[0], &route_params).unwrap()
+ };