+
+ /// Sets the maximum number of hops that can be included in a payment path, based on the provided
+ /// [`RecipientOnionFields`] and blinded paths.
+ pub fn set_max_path_length(
+ &mut self, recipient_onion: &RecipientOnionFields, is_keysend: bool, best_block_height: u32
+ ) -> Result<(), ()> {
+ let keysend_preimage_opt = is_keysend.then(|| PaymentPreimage([42; 32]));
+ onion_utils::set_max_path_length(
+ self, recipient_onion, keysend_preimage_opt, best_block_height
+ )
+ }