@@ -175,7 +175,7 @@ for OnionMessenger<ES, NS, L, NL, MR, OMH, APH, CMH> where
175175/// # })
176176/// # }
177177/// # fn create_blinded_paths<T: secp256k1::Signing + secp256k1::Verification>(
178- /// # &self, _params: BlindedPathParams, _recipient: PublicKey, _context: MessageContext, _peers: Vec<PublicKey >, _secp_ctx: &Secp256k1<T>
178+ /// # &self, _params: BlindedPathParams, _recipient: PublicKey, _context: MessageContext, _peers: Vec<ForwardNode >, _secp_ctx: &Secp256k1<T>
179179/// # ) -> Result<Vec<BlindedPath>, ()> {
180180/// # unreachable!()
181181/// # }
@@ -461,40 +461,8 @@ pub trait MessageRouter {
461461 fn create_blinded_paths <
462462 T : secp256k1:: Signing + secp256k1:: Verification
463463 > (
464- & self , params : BlindedPathParams , recipient : PublicKey , context : MessageContext , peers : Vec < PublicKey > , secp_ctx : & Secp256k1 < T > ,
464+ & self , params : BlindedPathParams , recipient : PublicKey , context : MessageContext , peers : Vec < ForwardNode > , secp_ctx : & Secp256k1 < T > ,
465465 ) -> Result < Vec < BlindedPath > , ( ) > ;
466-
467- /// Creates compact [`BlindedPath`]s to the `recipient` node. The nodes in `peers` are assumed
468- /// to be direct peers with the `recipient`.
469- ///
470- /// Compact blinded paths use short channel ids instead of pubkeys for a smaller serialization,
471- /// which is beneficial when a QR code is used to transport the data. The SCID is passed using a
472- /// [`ForwardNode`] but may be `None` for graceful degradation.
473- ///
474- /// Implementations using additional intermediate nodes are responsible for using a
475- /// [`ForwardNode`] with `Some` short channel id, if possible. Similarly, implementations should
476- /// call [`BlindedPath::use_compact_introduction_node`].
477- ///
478- /// The provided implementation simply delegates to [`MessageRouter::create_blinded_paths`],
479- /// ignoring the short channel ids.
480- fn create_compact_blinded_paths <
481- T : secp256k1:: Signing + secp256k1:: Verification
482- > (
483- & self , recipient : PublicKey , context : MessageContext ,
484- peers : Vec < ForwardNode > , secp_ctx : & Secp256k1 < T > ,
485- ) -> Result < Vec < BlindedPath > , ( ) > {
486- let peers = peers
487- . into_iter ( )
488- . map ( |ForwardNode { node_id, short_channel_id : _ } | node_id)
489- . collect ( ) ;
490-
491- // This parameter is a placeholder. This function is removed in the subsequent commits.
492- let params = BlindedPathParams {
493- paths : PATHS_PLACEHOLDER ,
494- is_compact : true ,
495- } ;
496- self . create_blinded_paths ( params, recipient, context, peers, secp_ctx)
497- }
498466}
499467
500468/// A [`MessageRouter`] that can only route to a directly connected [`Destination`].
@@ -628,24 +596,8 @@ where
628596 T : secp256k1:: Signing + secp256k1:: Verification
629597 > (
630598 params : BlindedPathParams , network_graph : & G , recipient : PublicKey , context : MessageContext ,
631- peers : Vec < PublicKey > , entropy_source : & ES , secp_ctx : & Secp256k1 < T > ,
632- ) -> Result < Vec < BlindedPath > , ( ) > {
633- let peers = peers
634- . into_iter ( )
635- . map ( |node_id| ForwardNode { node_id, short_channel_id : None } ) ;
636- Self :: create_blinded_paths_from_iter ( params, network_graph, recipient, context, peers. into_iter ( ) , entropy_source, secp_ctx)
637- }
638-
639- pub ( crate ) fn create_compact_blinded_paths <
640- T : secp256k1:: Signing + secp256k1:: Verification
641- > (
642- network_graph : & G , recipient : PublicKey , context : MessageContext ,
643599 peers : Vec < ForwardNode > , entropy_source : & ES , secp_ctx : & Secp256k1 < T > ,
644600 ) -> Result < Vec < BlindedPath > , ( ) > {
645- let params = BlindedPathParams {
646- paths : PATHS_PLACEHOLDER ,
647- is_compact : true ,
648- } ;
649601 Self :: create_blinded_paths_from_iter ( params, network_graph, recipient, context, peers. into_iter ( ) , entropy_source, secp_ctx)
650602 }
651603}
@@ -664,19 +616,10 @@ where
664616 fn create_blinded_paths <
665617 T : secp256k1:: Signing + secp256k1:: Verification
666618 > (
667- & self , params : BlindedPathParams , recipient : PublicKey , context : MessageContext , peers : Vec < PublicKey > , secp_ctx : & Secp256k1 < T > ,
619+ & self , params : BlindedPathParams , recipient : PublicKey , context : MessageContext , peers : Vec < ForwardNode > , secp_ctx : & Secp256k1 < T > ,
668620 ) -> Result < Vec < BlindedPath > , ( ) > {
669621 Self :: create_blinded_paths ( params, & self . network_graph , recipient, context, peers, & self . entropy_source , secp_ctx)
670622 }
671-
672- fn create_compact_blinded_paths <
673- T : secp256k1:: Signing + secp256k1:: Verification
674- > (
675- & self , recipient : PublicKey , context : MessageContext , peers : Vec < ForwardNode > , secp_ctx : & Secp256k1 < T > ,
676- ) -> Result < Vec < BlindedPath > , ( ) > {
677- Self :: create_compact_blinded_paths ( & self . network_graph , recipient, context, peers, & self . entropy_source , secp_ctx)
678- }
679-
680623}
681624
682625/// A path for sending an [`OnionMessage`].
@@ -1251,7 +1194,7 @@ where
12511194 let peers = self . message_recipients . lock ( ) . unwrap ( )
12521195 . iter ( )
12531196 . filter ( |( _, peer) | matches ! ( peer, OnionMessageRecipient :: ConnectedPeer ( _) ) )
1254- . map ( |( node_id, _ ) | * node_id)
1197+ . map ( |( node_id, _) | ForwardNode { node_id : * node_id, short_channel_id : None } )
12551198 . collect :: < Vec < _ > > ( ) ;
12561199
12571200 self . message_router
0 commit comments