From 08a39c5fd51c56096be4158b1204f1b092ba0e1e 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 7f2724cb0ae..385ac62af03 100644 --- a/lightning/src/blinded_path/message.rs +++ b/lightning/src/blinded_path/message.rs @@ -242,11 +242,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 f7b2de63207..edd12dbdef7 100644 --- a/lightning/src/blinded_path/payment.rs +++ b/lightning/src/blinded_path/payment.rs @@ -327,11 +327,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