@@ -215,7 +215,7 @@ where
215215/// # })
216216/// # }
217217/// # fn create_blinded_paths<T: secp256k1::Signing + secp256k1::Verification>(
218- /// # &self, _recipient: PublicKey, _context: MessageContext, _peers: Vec<PublicKey >, _secp_ctx: &Secp256k1<T>
218+ /// # &self, _recipient: PublicKey, _context: MessageContext, _peers: Vec<MessageForwardNode >, _secp_ctx: &Secp256k1<T>
219219/// # ) -> Result<Vec<BlindedMessagePath>, ()> {
220220/// # unreachable!()
221221/// # }
@@ -493,7 +493,7 @@ pub trait MessageRouter {
493493 /// Creates [`BlindedMessagePath`]s to the `recipient` node. The nodes in `peers` are assumed to
494494 /// be direct peers with the `recipient`.
495495 fn create_blinded_paths < T : secp256k1:: Signing + secp256k1:: Verification > (
496- & self , recipient : PublicKey , context : MessageContext , peers : Vec < PublicKey > ,
496+ & self , recipient : PublicKey , context : MessageContext , peers : Vec < MessageForwardNode > ,
497497 secp_ctx : & Secp256k1 < T > ,
498498 ) -> Result < Vec < BlindedMessagePath > , ( ) > ;
499499
@@ -514,10 +514,6 @@ pub trait MessageRouter {
514514 & self , recipient : PublicKey , context : MessageContext , peers : Vec < MessageForwardNode > ,
515515 secp_ctx : & Secp256k1 < T > ,
516516 ) -> Result < Vec < BlindedMessagePath > , ( ) > {
517- let peers = peers
518- . into_iter ( )
519- . map ( |MessageForwardNode { node_id, short_channel_id : _ } | node_id)
520- . collect ( ) ;
521517 self . create_blinded_paths ( recipient, context, peers, secp_ctx)
522518 }
523519}
@@ -549,7 +545,7 @@ where
549545 Self { network_graph, entropy_source }
550546 }
551547
552- fn create_blinded_paths_from_iter <
548+ pub ( crate ) fn create_blinded_paths_from_iter <
553549 I : ExactSizeIterator < Item = MessageForwardNode > ,
554550 T : secp256k1:: Signing + secp256k1:: Verification ,
555551 > (
@@ -663,38 +659,6 @@ where
663659 }
664660 }
665661 }
666-
667- pub ( crate ) fn create_blinded_paths < T : secp256k1:: Signing + secp256k1:: Verification > (
668- network_graph : & G , recipient : PublicKey , context : MessageContext , peers : Vec < PublicKey > ,
669- entropy_source : & ES , secp_ctx : & Secp256k1 < T > ,
670- ) -> Result < Vec < BlindedMessagePath > , ( ) > {
671- let peers =
672- peers. into_iter ( ) . map ( |node_id| MessageForwardNode { node_id, short_channel_id : None } ) ;
673- Self :: create_blinded_paths_from_iter (
674- network_graph,
675- recipient,
676- context,
677- peers. into_iter ( ) ,
678- entropy_source,
679- secp_ctx,
680- false ,
681- )
682- }
683-
684- pub ( crate ) fn create_compact_blinded_paths < T : secp256k1:: Signing + secp256k1:: Verification > (
685- network_graph : & G , recipient : PublicKey , context : MessageContext ,
686- peers : Vec < MessageForwardNode > , entropy_source : & ES , secp_ctx : & Secp256k1 < T > ,
687- ) -> Result < Vec < BlindedMessagePath > , ( ) > {
688- Self :: create_blinded_paths_from_iter (
689- network_graph,
690- recipient,
691- context,
692- peers. into_iter ( ) ,
693- entropy_source,
694- secp_ctx,
695- true ,
696- )
697- }
698662}
699663
700664impl < G : Deref < Target = NetworkGraph < L > > , L : Deref , ES : Deref > MessageRouter
@@ -710,30 +674,32 @@ where
710674 }
711675
712676 fn create_blinded_paths < T : secp256k1:: Signing + secp256k1:: Verification > (
713- & self , recipient : PublicKey , context : MessageContext , peers : Vec < PublicKey > ,
677+ & self , recipient : PublicKey , context : MessageContext , peers : Vec < MessageForwardNode > ,
714678 secp_ctx : & Secp256k1 < T > ,
715679 ) -> Result < Vec < BlindedMessagePath > , ( ) > {
716- Self :: create_blinded_paths (
680+ Self :: create_blinded_paths_from_iter (
717681 & self . network_graph ,
718682 recipient,
719683 context,
720- peers,
684+ peers. into_iter ( ) ,
721685 & self . entropy_source ,
722686 secp_ctx,
687+ false ,
723688 )
724689 }
725690
726691 fn create_compact_blinded_paths < T : secp256k1:: Signing + secp256k1:: Verification > (
727692 & self , recipient : PublicKey , context : MessageContext , peers : Vec < MessageForwardNode > ,
728693 secp_ctx : & Secp256k1 < T > ,
729694 ) -> Result < Vec < BlindedMessagePath > , ( ) > {
730- Self :: create_compact_blinded_paths (
695+ Self :: create_blinded_paths_from_iter (
731696 & self . network_graph ,
732697 recipient,
733698 context,
734- peers,
699+ peers. into_iter ( ) ,
735700 & self . entropy_source ,
736701 secp_ctx,
702+ true ,
737703 )
738704 }
739705}
@@ -1406,7 +1372,10 @@ where
14061372 message_recipients
14071373 . iter ( )
14081374 . filter ( |( _, peer) | matches ! ( peer, OnionMessageRecipient :: ConnectedPeer ( _) ) )
1409- . map ( |( node_id, _) | * node_id)
1375+ . map ( |( node_id, _) | MessageForwardNode {
1376+ node_id : * node_id,
1377+ short_channel_id : None ,
1378+ } )
14101379 . collect :: < Vec < _ > > ( )
14111380 } ;
14121381
0 commit comments