- /// Create a blinded path for a payment, to be forwarded along `path`. The last node
- /// in `path` will be the destination node.
+ /// Create a one-hop blinded path for a payment.
+ pub fn one_hop_for_payment<ES: EntropySource + ?Sized, T: secp256k1::Signing + secp256k1::Verification>(
+ payee_node_id: PublicKey, payee_tlvs: payment::ReceiveTlvs, entropy_source: &ES,
+ secp_ctx: &Secp256k1<T>
+ ) -> Result<(BlindedPayInfo, Self), ()> {
+ // This value is not considered in pathfinding for 1-hop blinded paths, because it's intended to
+ // be in relation to a specific channel.
+ let htlc_maximum_msat = u64::max_value();
+ Self::new_for_payment(
+ &[], payee_node_id, payee_tlvs, htlc_maximum_msat, entropy_source, secp_ctx
+ )
+ }
+
+ /// Create a blinded path for a payment, to be forwarded along `intermediate_nodes`.
+ ///
+ /// Errors if:
+ /// * a provided node id is invalid
+ /// * [`BlindedPayInfo`] calculation results in an integer overflow
+ /// * any unknown features are required in the provided [`ForwardTlvs`]