diff --git a/lightning/src/blinded_path/message.rs b/lightning/src/blinded_path/message.rs index ab15c7bc624..f576804304d 100644 --- a/lightning/src/blinded_path/message.rs +++ b/lightning/src/blinded_path/message.rs @@ -14,7 +14,7 @@ use bitcoin::secp256k1::{self, PublicKey, Secp256k1, SecretKey}; #[allow(unused_imports)] use crate::prelude::*; -use crate::blinded_path::{BlindedHop, BlindedPath, IntroductionNode, NextMessageHop, NodeIdLookUp}; +use crate::blinded_path::{BlindedHop, BlindedPath, IntroductionNode, NodeIdLookUp}; use crate::blinded_path::utils; use crate::io; use crate::io::Cursor; @@ -74,6 +74,18 @@ impl BlindedMessagePath { } } +/// The next hop to forward an onion message along its path. +/// +/// Note that payment blinded paths always specify their next hop using an explicit node id. +#[derive(Clone, Debug, Hash, PartialEq, Eq)] +pub enum NextMessageHop { + /// The node id of the next hop. + NodeId(PublicKey), + /// The short channel id leading to the next hop. + ShortChannelId(u64), +} + + /// An intermediate node, and possibly a short channel id leading to the next node. #[derive(Clone, Copy, Debug, Hash, PartialEq, Eq)] pub struct ForwardNode { diff --git a/lightning/src/blinded_path/mod.rs b/lightning/src/blinded_path/mod.rs index c50fd80db8f..3e88f02da4b 100644 --- a/lightning/src/blinded_path/mod.rs +++ b/lightning/src/blinded_path/mod.rs @@ -24,17 +24,6 @@ use crate::util::scid_utils; use crate::io; use crate::prelude::*; -/// The next hop to forward an onion message along its path. -/// -/// Note that payment blinded paths always specify their next hop using an explicit node id. -#[derive(Clone, Debug, Hash, PartialEq, Eq)] -pub enum NextMessageHop { - /// The node id of the next hop. - NodeId(PublicKey), - /// The short channel id leading to the next hop. - ShortChannelId(u64), -} - /// Onion messages and payments can be sent and received to blinded paths, which serve to hide the /// identity of the recipient. #[derive(Clone, Debug, Hash, PartialEq, Eq)] diff --git a/lightning/src/onion_message/messenger.rs b/lightning/src/onion_message/messenger.rs index c05024b3131..0c897df8c09 100644 --- a/lightning/src/onion_message/messenger.rs +++ b/lightning/src/onion_message/messenger.rs @@ -15,8 +15,8 @@ use bitcoin::hashes::hmac::{Hmac, HmacEngine}; use bitcoin::hashes::sha256::Hash as Sha256; use bitcoin::secp256k1::{self, PublicKey, Scalar, Secp256k1, SecretKey}; -use crate::blinded_path::{BlindedPath, IntroductionNode, NextMessageHop, NodeIdLookUp}; -use crate::blinded_path::message::{advance_path_by_one, BlindedMessagePath, ForwardNode, ForwardTlvs, MessageContext, ReceiveTlvs}; +use crate::blinded_path::{BlindedPath, IntroductionNode, NodeIdLookUp}; +use crate::blinded_path::message::{advance_path_by_one, BlindedMessagePath, ForwardNode, ForwardTlvs, MessageContext, NextMessageHop, ReceiveTlvs}; use crate::blinded_path::utils; use crate::events::{Event, EventHandler, EventsProvider, ReplayEvent}; use crate::sign::{EntropySource, NodeSigner, Recipient}; diff --git a/lightning/src/onion_message/packet.rs b/lightning/src/onion_message/packet.rs index 88302b106e9..553d7021674 100644 --- a/lightning/src/onion_message/packet.rs +++ b/lightning/src/onion_message/packet.rs @@ -12,8 +12,7 @@ use bitcoin::secp256k1::PublicKey; use bitcoin::secp256k1::ecdh::SharedSecret; -use crate::blinded_path::NextMessageHop; -use crate::blinded_path::message::{BlindedMessagePath, ForwardTlvs, ReceiveTlvs}; +use crate::blinded_path::message::{BlindedMessagePath, ForwardTlvs, NextMessageHop, ReceiveTlvs}; use crate::blinded_path::utils::Padding; use crate::ln::msgs::DecodeError; use crate::ln::onion_utils;