From 4dba7a314ce175f9e5fd51856c914b11923738ed Mon Sep 17 00:00:00 2001 From: Valentine Wallace Date: Mon, 5 Aug 2024 16:30:31 -0700 Subject: [PATCH] Expose blinded paths' advance_path_by_one methods. Useful for LDK users that are using the onion messages module, like LNDK. --- lightning/src/blinded_path/message.rs | 10 +++++----- lightning/src/blinded_path/payment.rs | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lightning/src/blinded_path/message.rs b/lightning/src/blinded_path/message.rs index 846886dcc..0b575e842 100644 --- a/lightning/src/blinded_path/message.rs +++ b/lightning/src/blinded_path/message.rs @@ -258,11 +258,11 @@ pub(super) fn blinded_hops( utils::construct_blinded_hops(secp_ctx, pks, tlvs, session_priv) } -// Advance the blinded onion message path by one hop, so make the second hop into the new -// introduction node. -// -// Will only modify `path` when returning `Ok`. -pub(crate) fn advance_path_by_one( +/// Advance the blinded onion message path by one hop, so make the second hop into the new +/// introduction node. +/// +/// Will only modify `path` when returning `Ok`. +pub fn advance_path_by_one( path: &mut BlindedMessagePath, node_signer: &NS, node_id_lookup: &NL, secp_ctx: &Secp256k1 ) -> Result<(), ()> where diff --git a/lightning/src/blinded_path/payment.rs b/lightning/src/blinded_path/payment.rs index a7191656a..27033c058 100644 --- a/lightning/src/blinded_path/payment.rs +++ b/lightning/src/blinded_path/payment.rs @@ -341,11 +341,11 @@ pub(super) fn blinded_hops( utils::construct_blinded_hops(secp_ctx, pks, tlvs, session_priv) } -// Advance the blinded onion payment path by one hop, so make the second hop into the new -// introduction node. -// -// Will only modify `path` when returning `Ok`. -pub(crate) fn advance_path_by_one( +/// Advance the blinded onion payment path by one hop, so make the second hop into the new +/// introduction node. +/// +/// Will only modify `path` when returning `Ok`. +pub fn advance_path_by_one( path: &mut BlindedPaymentPath, node_signer: &NS, node_id_lookup: &NL, secp_ctx: &Secp256k1 ) -> Result<(), ()> where -- 2.39.5