@@ -76,6 +76,19 @@ impl BlindedPath {
7676 } )
7777 }
7878
79+ /// Create a one-hop blinded path for a payment.
80+ pub fn one_hop_for_payment < ES : EntropySource , T : secp256k1:: Signing + secp256k1:: Verification > (
81+ payee_node_id : PublicKey , payee_tlvs : payment:: ReceiveTlvs , entropy_source : & ES ,
82+ secp_ctx : & Secp256k1 < T >
83+ ) -> Result < ( BlindedPayInfo , Self ) , ( ) > {
84+ // This value is not considered in pathfinding for 1-hop blinded paths, because it's intended to
85+ // be in relation to a specific channel.
86+ let htlc_maximum_msat = u64:: max_value ( ) ;
87+ Self :: new_for_payment (
88+ & [ ] , payee_node_id, payee_tlvs, htlc_maximum_msat, entropy_source, secp_ctx
89+ )
90+ }
91+
7992 /// Create a blinded path for a payment, to be forwarded along `intermediate_nodes`.
8093 ///
8194 /// Errors if:
@@ -85,7 +98,7 @@ impl BlindedPath {
8598 ///
8699 /// [`ForwardTlvs`]: crate::blinded_path::payment::ForwardTlvs
87100 // TODO: make all payloads the same size with padding + add dummy hops
88- pub fn new_for_payment < ES : EntropySource , T : secp256k1:: Signing + secp256k1:: Verification > (
101+ pub ( crate ) fn new_for_payment < ES : EntropySource , T : secp256k1:: Signing + secp256k1:: Verification > (
89102 intermediate_nodes : & [ payment:: ForwardNode ] , payee_node_id : PublicKey ,
90103 payee_tlvs : payment:: ReceiveTlvs , htlc_maximum_msat : u64 , entropy_source : & ES ,
91104 secp_ctx : & Secp256k1 < T >
0 commit comments