use bitcoin::secp256k1::{self, Keypair, Parity, PublicKey, Secp256k1, SecretKey};
use core::convert::TryFrom;
use lightning::blinded_path::payment::{
- BlindedPaymentPath, Bolt12OfferContext, ForwardNode, ForwardTlvs, PaymentConstraints,
- PaymentContext, PaymentRelay, ReceiveTlvs,
+ BlindedPaymentPath, Bolt12OfferContext, ForwardTlvs, PaymentConstraints, PaymentContext,
+ PaymentForwardNode, PaymentRelay, ReceiveTlvs,
};
use lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA;
use lightning::ln::features::BlindedHopFeatures;
},
payment_context,
};
- let intermediate_nodes = [ForwardNode {
+ let intermediate_nodes = [PaymentForwardNode {
tlvs: ForwardTlvs {
short_channel_id: 43,
payment_relay: PaymentRelay {
use bitcoin::secp256k1::{self, Keypair, PublicKey, Secp256k1, SecretKey};
use core::convert::TryFrom;
use lightning::blinded_path::payment::{
- BlindedPaymentPath, Bolt12RefundContext, ForwardNode, ForwardTlvs, PaymentConstraints,
- PaymentContext, PaymentRelay, ReceiveTlvs,
+ BlindedPaymentPath, Bolt12RefundContext, ForwardTlvs, PaymentConstraints, PaymentContext,
+ PaymentForwardNode, PaymentRelay, ReceiveTlvs,
};
use lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA;
use lightning::ln::features::BlindedHopFeatures;
},
payment_context,
};
- let intermediate_nodes = [ForwardNode {
+ let intermediate_nodes = [PaymentForwardNode {
tlvs: ForwardTlvs {
short_channel_id: 43,
payment_relay: PaymentRelay {
/// Errors if no hops are provided or if `node_pk`(s) are invalid.
// TODO: make all payloads the same size with padding + add dummy hops
pub fn new<ES: Deref, T: secp256k1::Signing + secp256k1::Verification>(
- intermediate_nodes: &[ForwardNode], recipient_node_id: PublicKey, context: MessageContext,
- entropy_source: ES, secp_ctx: &Secp256k1<T>
+ intermediate_nodes: &[MessageForwardNode], recipient_node_id: PublicKey,
+ context: MessageContext, entropy_source: ES, secp_ctx: &Secp256k1<T>,
) -> Result<Self, ()> where ES::Target: EntropySource {
let introduction_node = IntroductionNode::NodeId(
intermediate_nodes.first().map_or(recipient_node_id, |n| n.node_id)
/// An intermediate node, and possibly a short channel id leading to the next node.
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq)]
-pub struct ForwardNode {
+pub struct MessageForwardNode {
/// This node's pubkey.
pub node_id: PublicKey,
/// The channel between `node_id` and the next hop. If set, the constructed [`BlindedHop`]'s
- /// `encrypted_payload` will use this instead of the next [`ForwardNode::node_id`] for a more
- /// compact representation.
+ /// `encrypted_payload` will use this instead of the next [`MessageForwardNode::node_id`] for a
+ /// more compact representation.
pub short_channel_id: Option<u64>,
}
/// Construct blinded onion message hops for the given `intermediate_nodes` and `recipient_node_id`.
pub(super) fn blinded_hops<T: secp256k1::Signing + secp256k1::Verification>(
- secp_ctx: &Secp256k1<T>, intermediate_nodes: &[ForwardNode], recipient_node_id: PublicKey,
- context: MessageContext, session_priv: &SecretKey
+ secp_ctx: &Secp256k1<T>, intermediate_nodes: &[MessageForwardNode],
+ recipient_node_id: PublicKey, context: MessageContext, session_priv: &SecretKey,
) -> Result<Vec<BlindedHop>, secp256k1::Error> {
let pks = intermediate_nodes.iter().map(|node| &node.node_id)
.chain(core::iter::once(&recipient_node_id));
/// * any unknown features are required in the provided [`ForwardTlvs`]
// TODO: make all payloads the same size with padding + add dummy hops
pub fn new<ES: Deref, T: secp256k1::Signing + secp256k1::Verification>(
- intermediate_nodes: &[ForwardNode], payee_node_id: PublicKey, payee_tlvs: ReceiveTlvs,
- htlc_maximum_msat: u64, min_final_cltv_expiry_delta: u16, entropy_source: ES,
- secp_ctx: &Secp256k1<T>
+ intermediate_nodes: &[PaymentForwardNode], payee_node_id: PublicKey,
+ payee_tlvs: ReceiveTlvs, htlc_maximum_msat: u64, min_final_cltv_expiry_delta: u16,
+ entropy_source: ES, secp_ctx: &Secp256k1<T>,
) -> Result<Self, ()> where ES::Target: EntropySource {
let introduction_node = IntroductionNode::NodeId(
intermediate_nodes.first().map_or(payee_node_id, |n| n.node_id)
/// An intermediate node, its outbound channel, and relay parameters.
#[derive(Clone, Debug)]
-pub struct ForwardNode {
+pub struct PaymentForwardNode {
/// The TLVs for this node's [`BlindedHop`], where the fee parameters contained within are also
/// used for [`BlindedPayInfo`] construction.
pub tlvs: ForwardTlvs,
/// Construct blinded payment hops for the given `intermediate_nodes` and payee info.
pub(super) fn blinded_hops<T: secp256k1::Signing + secp256k1::Verification>(
- secp_ctx: &Secp256k1<T>, intermediate_nodes: &[ForwardNode],
- payee_node_id: PublicKey, payee_tlvs: ReceiveTlvs, session_priv: &SecretKey
+ secp_ctx: &Secp256k1<T>, intermediate_nodes: &[PaymentForwardNode],
+ payee_node_id: PublicKey, payee_tlvs: ReceiveTlvs, session_priv: &SecretKey,
) -> Result<Vec<BlindedHop>, secp256k1::Error> {
let pks = intermediate_nodes.iter().map(|node| &node.node_id)
.chain(core::iter::once(&payee_node_id));
}
pub(super) fn compute_payinfo(
- intermediate_nodes: &[ForwardNode], payee_tlvs: &ReceiveTlvs, payee_htlc_maximum_msat: u64,
- min_final_cltv_expiry_delta: u16
+ intermediate_nodes: &[PaymentForwardNode], payee_tlvs: &ReceiveTlvs,
+ payee_htlc_maximum_msat: u64, min_final_cltv_expiry_delta: u16,
) -> Result<BlindedPayInfo, ()> {
let mut curr_base_fee: u64 = 0;
let mut curr_prop_mil: u64 = 0;
#[cfg(test)]
mod tests {
use bitcoin::secp256k1::PublicKey;
- use crate::blinded_path::payment::{ForwardNode, ForwardTlvs, ReceiveTlvs, PaymentConstraints, PaymentContext, PaymentRelay};
+ use crate::blinded_path::payment::{PaymentForwardNode, ForwardTlvs, ReceiveTlvs, PaymentConstraints, PaymentContext, PaymentRelay};
use crate::ln::types::PaymentSecret;
use crate::ln::features::BlindedHopFeatures;
use crate::ln::functional_test_utils::TEST_FINAL_CLTV;
// Taken from the spec example for aggregating blinded payment info. See
// https://github.com/lightning/bolts/blob/master/proposals/route-blinding.md#blinded-payments
let dummy_pk = PublicKey::from_slice(&[2; 33]).unwrap();
- let intermediate_nodes = vec![ForwardNode {
+ let intermediate_nodes = vec![PaymentForwardNode {
node_id: dummy_pk,
tlvs: ForwardTlvs {
short_channel_id: 0,
features: BlindedHopFeatures::empty(),
},
htlc_maximum_msat: u64::max_value(),
- }, ForwardNode {
+ }, PaymentForwardNode {
node_id: dummy_pk,
tlvs: ForwardTlvs {
short_channel_id: 0,
// If no hops charge fees, the htlc_minimum_msat should just be the maximum htlc_minimum_msat
// along the path.
let dummy_pk = PublicKey::from_slice(&[2; 33]).unwrap();
- let intermediate_nodes = vec![ForwardNode {
+ let intermediate_nodes = vec![PaymentForwardNode {
node_id: dummy_pk,
tlvs: ForwardTlvs {
short_channel_id: 0,
features: BlindedHopFeatures::empty(),
},
htlc_maximum_msat: u64::max_value()
- }, ForwardNode {
+ }, PaymentForwardNode {
node_id: dummy_pk,
tlvs: ForwardTlvs {
short_channel_id: 0,
// Create a path with varying fees and htlc_mins, and make sure htlc_minimum_msat ends up as the
// max (htlc_min - following_fees) along the path.
let dummy_pk = PublicKey::from_slice(&[2; 33]).unwrap();
- let intermediate_nodes = vec![ForwardNode {
+ let intermediate_nodes = vec![PaymentForwardNode {
node_id: dummy_pk,
tlvs: ForwardTlvs {
short_channel_id: 0,
features: BlindedHopFeatures::empty(),
},
htlc_maximum_msat: u64::max_value()
- }, ForwardNode {
+ }, PaymentForwardNode {
node_id: dummy_pk,
tlvs: ForwardTlvs {
short_channel_id: 0,
// Create a path with varying fees and `htlc_maximum_msat`s, and make sure the aggregated max
// htlc ends up as the min (htlc_max - following_fees) along the path.
let dummy_pk = PublicKey::from_slice(&[2; 33]).unwrap();
- let intermediate_nodes = vec![ForwardNode {
+ let intermediate_nodes = vec![PaymentForwardNode {
node_id: dummy_pk,
tlvs: ForwardTlvs {
short_channel_id: 0,
features: BlindedHopFeatures::empty(),
},
htlc_maximum_msat: 5_000,
- }, ForwardNode {
+ }, PaymentForwardNode {
node_id: dummy_pk,
tlvs: ForwardTlvs {
short_channel_id: 0,
use bitcoin::secp256k1::ecdh::SharedSecret;
use bitcoin::secp256k1::ecdsa::{RecoverableSignature, Signature};
use crate::blinded_path;
-use crate::blinded_path::payment::{BlindedPaymentPath, ForwardNode, ForwardTlvs, PaymentConstraints, PaymentContext, PaymentRelay, ReceiveTlvs};
+use crate::blinded_path::payment::{BlindedPaymentPath, PaymentForwardNode, ForwardTlvs, PaymentConstraints, PaymentContext, PaymentRelay, ReceiveTlvs};
use crate::events::{Event, HTLCDestination, MessageSendEvent, MessageSendEventsProvider, PaymentFailureReason};
use crate::ln::types::{ChannelId, PaymentHash, PaymentSecret};
use crate::ln::channelmanager;
let mut intro_node_min_htlc_opt = Some(intro_node_min_htlc);
let mut intro_node_max_htlc_opt = Some(intro_node_max_htlc);
for (idx, (node_id, chan_upd)) in node_ids.iter().zip(channel_upds).enumerate() {
- intermediate_nodes.push(ForwardNode {
+ intermediate_nodes.push(PaymentForwardNode {
node_id: *node_id,
tlvs: ForwardTlvs {
short_channel_id: chan_upd.short_channel_id,
use crate::blinded_path::message::{MessageContext, OffersContext};
use crate::blinded_path::NodeIdLookUp;
-use crate::blinded_path::message::{BlindedMessagePath, ForwardNode};
+use crate::blinded_path::message::{BlindedMessagePath, MessageForwardNode};
use crate::blinded_path::payment::{BlindedPaymentPath, Bolt12OfferContext, Bolt12RefundContext, PaymentConstraints, PaymentContext, ReceiveTlvs};
use crate::chain;
use crate::chain::{Confirm, ChannelMonitorUpdateStatus, Watch, BestBlock};
.map(|(node_id, peer_state)| (node_id, peer_state.lock().unwrap()))
.filter(|(_, peer)| peer.is_connected)
.filter(|(_, peer)| peer.latest_features.supports_onion_messages())
- .map(|(node_id, peer)| ForwardNode {
+ .map(|(node_id, peer)| MessageForwardNode {
node_id: *node_id,
short_channel_id: peer.channel_by_id
.iter()
//! Onion message testing and test utilities live here.
use crate::blinded_path::EmptyNodeIdLookUp;
-use crate::blinded_path::message::{BlindedMessagePath, ForwardNode, MessageContext, OffersContext};
+use crate::blinded_path::message::{BlindedMessagePath, MessageForwardNode, MessageContext, OffersContext};
use crate::events::{Event, EventsProvider};
use crate::ln::features::{ChannelFeatures, InitFeatures};
use crate::ln::msgs::{self, DecodeError, OnionMessageHandler};
let test_msg = TestCustomMessage::Pong;
let secp_ctx = Secp256k1::new();
- let intermediate_nodes = [ForwardNode { node_id: nodes[3].node_id, short_channel_id: None }];
+ let intermediate_nodes = [MessageForwardNode { node_id: nodes[3].node_id, short_channel_id: None }];
let context = MessageContext::Custom(Vec::new());
let blinded_path = BlindedMessagePath::new(&intermediate_nodes, nodes[4].node_id, context, &*nodes[4].entropy_source, &secp_ctx).unwrap();
let path = OnionMessagePath {
let secp_ctx = Secp256k1::new();
let intermediate_nodes = [
- ForwardNode { node_id: nodes[1].node_id, short_channel_id: None },
- ForwardNode { node_id: nodes[2].node_id, short_channel_id: None },
+ MessageForwardNode { node_id: nodes[1].node_id, short_channel_id: None },
+ MessageForwardNode { node_id: nodes[2].node_id, short_channel_id: None },
];
let context = MessageContext::Custom(Vec::new());
let blinded_path = BlindedMessagePath::new(&intermediate_nodes, nodes[3].node_id, context, &*nodes[3].entropy_source, &secp_ctx).unwrap();
let secp_ctx = Secp256k1::new();
let intermediate_nodes = [
- ForwardNode { node_id: nodes[0].node_id, short_channel_id: None },
- ForwardNode { node_id: nodes[1].node_id, short_channel_id: None },
+ MessageForwardNode { node_id: nodes[0].node_id, short_channel_id: None },
+ MessageForwardNode { node_id: nodes[1].node_id, short_channel_id: None },
];
let context = MessageContext::Custom(Vec::new());
let blinded_path = BlindedMessagePath::new(&intermediate_nodes, nodes[2].node_id, context, &*nodes[2].entropy_source, &secp_ctx).unwrap();
pass_along_path(&nodes);
// Try with a two-hop blinded path where we are the introduction node.
- let intermediate_nodes = [ForwardNode { node_id: nodes[0].node_id, short_channel_id: None }];
+ let intermediate_nodes = [MessageForwardNode { node_id: nodes[0].node_id, short_channel_id: None }];
let context = MessageContext::Custom(Vec::new());
let blinded_path = BlindedMessagePath::new(&intermediate_nodes, nodes[1].node_id, context, &*nodes[1].entropy_source, &secp_ctx).unwrap();
let destination = Destination::BlindedPath(blinded_path);
let test_msg = TestCustomMessage::Pong;
let secp_ctx = Secp256k1::new();
- let intermediate_nodes = [ForwardNode { node_id: nodes[1].node_id, short_channel_id: None }];
+ let intermediate_nodes = [MessageForwardNode { node_id: nodes[1].node_id, short_channel_id: None }];
let context = MessageContext::Custom(Vec::new());
let mut blinded_path = BlindedMessagePath::new(&intermediate_nodes, nodes[2].node_id, context, &*nodes[2].entropy_source, &secp_ctx).unwrap();
blinded_path.clear_blinded_hops();
first_node_addresses: None,
};
let intermediate_nodes = [
- ForwardNode { node_id: nodes[2].node_id, short_channel_id: None },
- ForwardNode { node_id: nodes[1].node_id, short_channel_id: None },
+ MessageForwardNode { node_id: nodes[2].node_id, short_channel_id: None },
+ MessageForwardNode { node_id: nodes[1].node_id, short_channel_id: None },
];
let context = MessageContext::Custom(Vec::new());
let reply_path = BlindedMessagePath::new(&intermediate_nodes, nodes[0].node_id, context, &*nodes[0].entropy_source, &secp_ctx).unwrap();
// Destination::BlindedPath
let intermediate_nodes = [
- ForwardNode { node_id: nodes[1].node_id, short_channel_id: None },
- ForwardNode { node_id: nodes[2].node_id, short_channel_id: None },
+ MessageForwardNode { node_id: nodes[1].node_id, short_channel_id: None },
+ MessageForwardNode { node_id: nodes[2].node_id, short_channel_id: None },
];
let context = MessageContext::Custom(Vec::new());
let blinded_path = BlindedMessagePath::new(&intermediate_nodes, nodes[3].node_id, context, &*nodes[3].entropy_source, &secp_ctx).unwrap();
let destination = Destination::BlindedPath(blinded_path);
let intermediate_nodes = [
- ForwardNode { node_id: nodes[2].node_id, short_channel_id: None },
- ForwardNode { node_id: nodes[1].node_id, short_channel_id: None },
+ MessageForwardNode { node_id: nodes[2].node_id, short_channel_id: None },
+ MessageForwardNode { node_id: nodes[1].node_id, short_channel_id: None },
];
let context = MessageContext::Custom(Vec::new());
let reply_path = BlindedMessagePath::new(&intermediate_nodes, nodes[0].node_id, context, &*nodes[0].entropy_source, &secp_ctx).unwrap();
let secp_ctx = Secp256k1::new();
add_channel_to_graph(&nodes[0], &nodes[1], &secp_ctx, 42);
- let intermediate_nodes = [ForwardNode { node_id: nodes[1].node_id, short_channel_id: None }];
+ let intermediate_nodes = [MessageForwardNode { node_id: nodes[1].node_id, short_channel_id: None }];
let context = MessageContext::Custom(Vec::new());
let blinded_path = BlindedMessagePath::new(
&intermediate_nodes, nodes[2].node_id, context, &*nodes[0].entropy_source, &secp_ctx
let secp_ctx = Secp256k1::new();
add_channel_to_graph(&nodes[0], &nodes[1], &secp_ctx, 42);
- let intermediate_nodes = [ForwardNode { node_id: nodes[1].node_id, short_channel_id: None }];
+ let intermediate_nodes = [MessageForwardNode { node_id: nodes[1].node_id, short_channel_id: None }];
let context = MessageContext::Custom(Vec::new());
let blinded_path = BlindedMessagePath::new(
&intermediate_nodes, nodes[2].node_id, context, &*nodes[0].entropy_source, &secp_ctx
let message = TestCustomMessage::Pong;
let secp_ctx = Secp256k1::new();
- let intermediate_nodes = [ForwardNode { node_id: nodes[1].node_id, short_channel_id: None }];
+ let intermediate_nodes = [MessageForwardNode { node_id: nodes[1].node_id, short_channel_id: None }];
let context = MessageContext::Custom(Vec::new());
let blinded_path = BlindedMessagePath::new(
&intermediate_nodes, nodes[2].node_id, context, &*nodes[2].entropy_source, &secp_ctx
use bitcoin::secp256k1::{self, PublicKey, Scalar, Secp256k1, SecretKey};
use crate::blinded_path::{IntroductionNode, NodeIdLookUp};
-use crate::blinded_path::message::{BlindedMessagePath, ForwardNode, ForwardTlvs, MessageContext, NextMessageHop, ReceiveTlvs};
+use crate::blinded_path::message::{BlindedMessagePath, MessageForwardNode, ForwardTlvs, MessageContext, NextMessageHop, ReceiveTlvs};
use crate::blinded_path::utils;
use crate::events::{Event, EventHandler, EventsProvider, ReplayEvent};
use crate::sign::{EntropySource, NodeSigner, Recipient};
/// # use bitcoin::hex::FromHex;
/// # use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey, self};
/// # use lightning::blinded_path::EmptyNodeIdLookUp;
-/// # use lightning::blinded_path::message::{BlindedMessagePath, ForwardNode, MessageContext};
+/// # use lightning::blinded_path::message::{BlindedMessagePath, MessageForwardNode, MessageContext};
/// # use lightning::sign::{EntropySource, KeysManager};
/// # use lightning::ln::peer_handler::IgnoringMessageHandler;
/// # use lightning::onion_message::messenger::{Destination, MessageRouter, OnionMessagePath, OnionMessenger};
/// // Create a blinded path to yourself, for someone to send an onion message to.
/// # let your_node_id = hop_node_id1;
/// let hops = [
-/// ForwardNode { node_id: hop_node_id3, short_channel_id: None },
-/// ForwardNode { node_id: hop_node_id4, short_channel_id: None },
+/// MessageForwardNode { node_id: hop_node_id3, short_channel_id: None },
+/// MessageForwardNode { node_id: hop_node_id4, short_channel_id: None },
/// ];
/// let context = MessageContext::Custom(Vec::new());
/// let blinded_path = BlindedMessagePath::new(&hops, your_node_id, context, &keys_manager, &secp_ctx).unwrap();
/// assumed to be direct peers with the `recipient`.
///
/// Compact blinded paths use short channel ids instead of pubkeys for a smaller serialization,
- /// which is beneficial when a QR code is used to transport the data. The SCID is passed using a
- /// [`ForwardNode`] but may be `None` for graceful degradation.
+ /// which is beneficial when a QR code is used to transport the data. The SCID is passed using
+ /// a [`MessageForwardNode`] but may be `None` for graceful degradation.
///
/// Implementations using additional intermediate nodes are responsible for using a
- /// [`ForwardNode`] with `Some` short channel id, if possible. Similarly, implementations should
- /// call [`BlindedMessagePath::use_compact_introduction_node`].
+ /// [`MessageForwardNode`] with `Some` short channel id, if possible. Similarly, implementations
+ /// should call [`BlindedMessagePath::use_compact_introduction_node`].
///
/// The provided implementation simply delegates to [`MessageRouter::create_blinded_paths`],
/// ignoring the short channel ids.
T: secp256k1::Signing + secp256k1::Verification
>(
&self, recipient: PublicKey, context: MessageContext,
- peers: Vec<ForwardNode>, secp_ctx: &Secp256k1<T>,
+ peers: Vec<MessageForwardNode>, secp_ctx: &Secp256k1<T>,
) -> Result<Vec<BlindedMessagePath>, ()> {
let peers = peers
.into_iter()
- .map(|ForwardNode { node_id, short_channel_id: _ }| node_id)
+ .map(|MessageForwardNode { node_id, short_channel_id: _ }| node_id)
.collect();
self.create_blinded_paths(recipient, context, peers, secp_ctx)
}
}
fn create_blinded_paths_from_iter<
- I: ExactSizeIterator<Item = ForwardNode>,
+ I: ExactSizeIterator<Item = MessageForwardNode>,
T: secp256k1::Signing + secp256k1::Verification
>(
network_graph: &G, recipient: PublicKey, context: MessageContext, peers: I,
) -> Result<Vec<BlindedMessagePath>, ()> {
let peers = peers
.into_iter()
- .map(|node_id| ForwardNode { node_id, short_channel_id: None });
+ .map(|node_id| MessageForwardNode { node_id, short_channel_id: None });
Self::create_blinded_paths_from_iter(network_graph, recipient, context, peers.into_iter(), entropy_source, secp_ctx, false)
}
T: secp256k1::Signing + secp256k1::Verification
>(
network_graph: &G, recipient: PublicKey, context: MessageContext,
- peers: Vec<ForwardNode>, entropy_source: &ES, secp_ctx: &Secp256k1<T>,
+ peers: Vec<MessageForwardNode>, entropy_source: &ES, secp_ctx: &Secp256k1<T>,
) -> Result<Vec<BlindedMessagePath>, ()> {
Self::create_blinded_paths_from_iter(network_graph, recipient, context, peers.into_iter(), entropy_source, secp_ctx, true)
}
fn create_compact_blinded_paths<
T: secp256k1::Signing + secp256k1::Verification
>(
- &self, recipient: PublicKey, context: MessageContext, peers: Vec<ForwardNode>, secp_ctx: &Secp256k1<T>,
+ &self, recipient: PublicKey, context: MessageContext, peers: Vec<MessageForwardNode>, secp_ctx: &Secp256k1<T>,
) -> Result<Vec<BlindedMessagePath>, ()> {
Self::create_compact_blinded_paths(&self.network_graph, recipient, context, peers, &self.entropy_source, secp_ctx)
}
use bitcoin::secp256k1::{PublicKey, Secp256k1, self};
use crate::blinded_path::{BlindedHop, Direction, IntroductionNode};
-use crate::blinded_path::message::{self, BlindedMessagePath, MessageContext};
-use crate::blinded_path::payment::{BlindedPaymentPath, ForwardTlvs, PaymentConstraints, PaymentRelay, ReceiveTlvs, self};
+use crate::blinded_path::message::{BlindedMessagePath, MessageContext, MessageForwardNode};
+use crate::blinded_path::payment::{BlindedPaymentPath, ForwardTlvs, PaymentConstraints, PaymentForwardNode, PaymentRelay, ReceiveTlvs};
use crate::ln::{PaymentHash, PaymentPreimage};
use crate::ln::channel_state::ChannelDetails;
use crate::ln::channelmanager::{PaymentId, MIN_FINAL_CLTV_EXPIRY_DELTA, RecipientOnionFields};
max_cltv_expiry: tlvs.payment_constraints.max_cltv_expiry + cltv_expiry_delta,
htlc_minimum_msat: details.inbound_htlc_minimum_msat.unwrap_or(0),
};
- Some(payment::ForwardNode {
+ Some(PaymentForwardNode {
tlvs: ForwardTlvs {
short_channel_id,
payment_relay,
fn create_compact_blinded_paths<
T: secp256k1::Signing + secp256k1::Verification
> (
- &self, recipient: PublicKey, context: MessageContext, peers: Vec<message::ForwardNode>, secp_ctx: &Secp256k1<T>,
+ &self, recipient: PublicKey, context: MessageContext, peers: Vec<MessageForwardNode>, secp_ctx: &Secp256k1<T>,
) -> Result<Vec<BlindedMessagePath>, ()> {
DefaultMessageRouter::create_compact_blinded_paths(&self.network_graph, recipient, context, peers, &self.entropy_source, secp_ctx)
}
// licenses.
use crate::blinded_path::message::MessageContext;
-use crate::blinded_path::message::{BlindedMessagePath, ForwardNode};
+use crate::blinded_path::message::{BlindedMessagePath, MessageForwardNode};
use crate::blinded_path::payment::{BlindedPaymentPath, ReceiveTlvs};
use crate::chain;
use crate::chain::WatchedOutput;
T: secp256k1::Signing + secp256k1::Verification
>(
&self, recipient: PublicKey, context: MessageContext,
- peers: Vec<ForwardNode>, secp_ctx: &Secp256k1<T>,
+ peers: Vec<MessageForwardNode>, secp_ctx: &Secp256k1<T>,
) -> Result<Vec<BlindedMessagePath>, ()> {
self.router.create_compact_blinded_paths(recipient, context, peers, secp_ctx)
}
fn create_compact_blinded_paths<T: secp256k1::Signing + secp256k1::Verification>(
&self, recipient: PublicKey, context: MessageContext,
- peers: Vec<ForwardNode>, secp_ctx: &Secp256k1<T>,
+ peers: Vec<MessageForwardNode>, secp_ctx: &Secp256k1<T>,
) -> Result<Vec<BlindedMessagePath>, ()> {
self.inner.create_compact_blinded_paths(recipient, context, peers, secp_ctx)
}