- pub fn new_for_message<ES: EntropySource + ?Sized, T: secp256k1::Signing + secp256k1::Verification>(
- node_pks: &[PublicKey], entropy_source: &ES, secp_ctx: &Secp256k1<T>
- ) -> Result<Self, ()> {
- if node_pks.is_empty() { return Err(()) }
+ pub fn new_for_message<ES: Deref, T: secp256k1::Signing + secp256k1::Verification>(
+ intermediate_nodes: &[message::ForwardNode], recipient_node_id: PublicKey,
+ 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)
+ );