Skip to content

Commit 983a343

Browse files
committed
blinded_path: add constructor for trampoline blinded path
1 parent 04e189d commit 983a343

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

lightning/src/blinded_path/payment.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,29 @@ impl BlindedPaymentPath {
161161
)
162162
}
163163

164+
/// Create a blinded path for a trampoline payment, to be forwarded along `intermediate_nodes`.
165+
#[cfg(any(test, feature = "_test_utils"))]
166+
pub(crate) fn new_for_trampoline<
167+
ES: EntropySource,
168+
T: secp256k1::Signing + secp256k1::Verification,
169+
>(
170+
intermediate_nodes: &[ForwardNode<TrampolineForwardTlvs>], payee_node_id: PublicKey,
171+
local_node_receive_key: ReceiveAuthKey, payee_tlvs: ReceiveTlvs, htlc_maximum_msat: u64,
172+
min_final_cltv_expiry_delta: u16, entropy_source: ES, secp_ctx: &Secp256k1<T>,
173+
) -> Result<Self, ()> {
174+
Self::new_inner(
175+
intermediate_nodes,
176+
payee_node_id,
177+
local_node_receive_key,
178+
&[],
179+
payee_tlvs,
180+
htlc_maximum_msat,
181+
min_final_cltv_expiry_delta,
182+
entropy_source,
183+
secp_ctx,
184+
)
185+
}
186+
164187
fn new_inner<
165188
F: ForwardTlvsInfo,
166189
ES: EntropySource,

0 commit comments

Comments
 (0)