@@ -175,7 +175,7 @@ for OnionMessenger<ES, NS, L, NL, MR, OMH, APH, CMH> where
175
175
/// # })
176
176
/// # }
177
177
/// # 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>
179
179
/// # ) -> Result<Vec<BlindedPath>, ()> {
180
180
/// # unreachable!()
181
181
/// # }
@@ -461,40 +461,8 @@ pub trait MessageRouter {
461
461
fn create_blinded_paths <
462
462
T : secp256k1:: Signing + secp256k1:: Verification
463
463
> (
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 > ,
465
465
) -> 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
- }
498
466
}
499
467
500
468
/// A [`MessageRouter`] that can only route to a directly connected [`Destination`].
@@ -628,24 +596,8 @@ where
628
596
T : secp256k1:: Signing + secp256k1:: Verification
629
597
> (
630
598
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 ,
643
599
peers : Vec < ForwardNode > , entropy_source : & ES , secp_ctx : & Secp256k1 < T > ,
644
600
) -> Result < Vec < BlindedPath > , ( ) > {
645
- let params = BlindedPathParams {
646
- paths : PATHS_PLACEHOLDER ,
647
- is_compact : true ,
648
- } ;
649
601
Self :: create_blinded_paths_from_iter ( params, network_graph, recipient, context, peers. into_iter ( ) , entropy_source, secp_ctx)
650
602
}
651
603
}
@@ -664,19 +616,10 @@ where
664
616
fn create_blinded_paths <
665
617
T : secp256k1:: Signing + secp256k1:: Verification
666
618
> (
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 > ,
668
620
) -> Result < Vec < BlindedPath > , ( ) > {
669
621
Self :: create_blinded_paths ( params, & self . network_graph , recipient, context, peers, & self . entropy_source , secp_ctx)
670
622
}
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
-
680
623
}
681
624
682
625
/// A path for sending an [`OnionMessage`].
@@ -1251,7 +1194,7 @@ where
1251
1194
let peers = self . message_recipients . lock ( ) . unwrap ( )
1252
1195
. iter ( )
1253
1196
. 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 } )
1255
1198
. collect :: < Vec < _ > > ( ) ;
1256
1199
1257
1200
self . message_router
0 commit comments