It's only used for onion messages, not payments.
use bitcoin::hashes::hmac::Hmac;
use bitcoin::hashes::sha256::Hash as Sha256;
-use crate::blinded_path::{BlindedHop, BlindedPath, Direction, IntroductionNode, NextMessageHop, NodeIdLookUp};
+use crate::blinded_path::{BlindedHop, BlindedPath, Direction, IntroductionNode, NodeIdLookUp};
use crate::blinded_path::utils;
use crate::io;
use crate::io::Cursor;
}
}
+/// 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 {
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)]
use bitcoin::hashes::sha256::Hash as Sha256;
use bitcoin::secp256k1::{self, PublicKey, Scalar, Secp256k1, SecretKey};
-use crate::blinded_path::{IntroductionNode, NextMessageHop, NodeIdLookUp};
-use crate::blinded_path::message::{advance_path_by_one, BlindedMessagePath, ForwardNode, ForwardTlvs, MessageContext, ReceiveTlvs};
+use crate::blinded_path::{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};
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;