@@ -217,7 +217,7 @@ where
217217/// # })
218218/// # }
219219/// # fn create_blinded_paths<T: secp256k1::Signing + secp256k1::Verification>(
220- /// # &self, _recipient: PublicKey, _context: MessageContext, _peers: Vec<PublicKey >, _secp_ctx: &Secp256k1<T>
220+ /// # &self, _recipient: PublicKey, _context: MessageContext, _peers: Vec<MessageForwardNode >, _secp_ctx: &Secp256k1<T>
221221/// # ) -> Result<Vec<BlindedMessagePath>, ()> {
222222/// # unreachable!()
223223/// # }
@@ -501,7 +501,7 @@ pub trait MessageRouter {
501501 /// Creates [`BlindedMessagePath`]s to the `recipient` node. The nodes in `peers` are assumed to
502502 /// be direct peers with the `recipient`.
503503 fn create_blinded_paths < T : secp256k1:: Signing + secp256k1:: Verification > (
504- & self , recipient : PublicKey , context : MessageContext , peers : Vec < PublicKey > ,
504+ & self , recipient : PublicKey , context : MessageContext , peers : Vec < MessageForwardNode > ,
505505 secp_ctx : & Secp256k1 < T > ,
506506 ) -> Result < Vec < BlindedMessagePath > , ( ) > ;
507507
@@ -522,10 +522,6 @@ pub trait MessageRouter {
522522 & self , recipient : PublicKey , context : MessageContext , peers : Vec < MessageForwardNode > ,
523523 secp_ctx : & Secp256k1 < T > ,
524524 ) -> Result < Vec < BlindedMessagePath > , ( ) > {
525- let peers = peers
526- . into_iter ( )
527- . map ( |MessageForwardNode { node_id, short_channel_id : _ } | node_id)
528- . collect ( ) ;
529525 self . create_blinded_paths ( recipient, context, peers, secp_ctx)
530526 }
531527}
@@ -557,7 +553,7 @@ where
557553 Self { network_graph, entropy_source }
558554 }
559555
560- fn create_blinded_paths_from_iter <
556+ pub ( crate ) fn create_blinded_paths_from_iter <
561557 I : ExactSizeIterator < Item = MessageForwardNode > ,
562558 T : secp256k1:: Signing + secp256k1:: Verification ,
563559 > (
@@ -671,38 +667,6 @@ where
671667 }
672668 }
673669 }
674-
675- pub ( crate ) fn create_blinded_paths < T : secp256k1:: Signing + secp256k1:: Verification > (
676- network_graph : & G , recipient : PublicKey , context : MessageContext , peers : Vec < PublicKey > ,
677- entropy_source : & ES , secp_ctx : & Secp256k1 < T > ,
678- ) -> Result < Vec < BlindedMessagePath > , ( ) > {
679- let peers =
680- peers. into_iter ( ) . map ( |node_id| MessageForwardNode { node_id, short_channel_id : None } ) ;
681- Self :: create_blinded_paths_from_iter (
682- network_graph,
683- recipient,
684- context,
685- peers. into_iter ( ) ,
686- entropy_source,
687- secp_ctx,
688- false ,
689- )
690- }
691-
692- pub ( crate ) fn create_compact_blinded_paths < T : secp256k1:: Signing + secp256k1:: Verification > (
693- network_graph : & G , recipient : PublicKey , context : MessageContext ,
694- peers : Vec < MessageForwardNode > , entropy_source : & ES , secp_ctx : & Secp256k1 < T > ,
695- ) -> Result < Vec < BlindedMessagePath > , ( ) > {
696- Self :: create_blinded_paths_from_iter (
697- network_graph,
698- recipient,
699- context,
700- peers. into_iter ( ) ,
701- entropy_source,
702- secp_ctx,
703- true ,
704- )
705- }
706670}
707671
708672impl < G : Deref < Target = NetworkGraph < L > > , L : Deref , ES : Deref > MessageRouter
@@ -718,30 +682,32 @@ where
718682 }
719683
720684 fn create_blinded_paths < T : secp256k1:: Signing + secp256k1:: Verification > (
721- & self , recipient : PublicKey , context : MessageContext , peers : Vec < PublicKey > ,
685+ & self , recipient : PublicKey , context : MessageContext , peers : Vec < MessageForwardNode > ,
722686 secp_ctx : & Secp256k1 < T > ,
723687 ) -> Result < Vec < BlindedMessagePath > , ( ) > {
724- Self :: create_blinded_paths (
688+ Self :: create_blinded_paths_from_iter (
725689 & self . network_graph ,
726690 recipient,
727691 context,
728- peers,
692+ peers. into_iter ( ) ,
729693 & self . entropy_source ,
730694 secp_ctx,
695+ false ,
731696 )
732697 }
733698
734699 fn create_compact_blinded_paths < T : secp256k1:: Signing + secp256k1:: Verification > (
735700 & self , recipient : PublicKey , context : MessageContext , peers : Vec < MessageForwardNode > ,
736701 secp_ctx : & Secp256k1 < T > ,
737702 ) -> Result < Vec < BlindedMessagePath > , ( ) > {
738- Self :: create_compact_blinded_paths (
703+ Self :: create_blinded_paths_from_iter (
739704 & self . network_graph ,
740705 recipient,
741706 context,
742- peers,
707+ peers. into_iter ( ) ,
743708 & self . entropy_source ,
744709 secp_ctx,
710+ true ,
745711 )
746712 }
747713}
@@ -1430,7 +1396,10 @@ where
14301396 message_recipients
14311397 . iter ( )
14321398 . filter ( |( _, peer) | matches ! ( peer, OnionMessageRecipient :: ConnectedPeer ( _) ) )
1433- . map ( |( node_id, _) | * node_id)
1399+ . map ( |( node_id, _) | MessageForwardNode {
1400+ node_id : * node_id,
1401+ short_channel_id : None ,
1402+ } )
14341403 . collect :: < Vec < _ > > ( )
14351404 } ;
14361405
0 commit comments