@@ -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<MessageForwardNode >, _secp_ctx: &Secp256k1<T>
179
179
/// # ) -> Result<Vec<BlindedMessagePath>, ()> {
180
180
/// # unreachable!()
181
181
/// # }
@@ -460,40 +460,8 @@ pub trait MessageRouter {
460
460
fn create_blinded_paths <
461
461
T : secp256k1:: Signing + secp256k1:: Verification
462
462
> (
463
- & self , params : BlindedPathParams , recipient : PublicKey , context : MessageContext , peers : Vec < PublicKey > , secp_ctx : & Secp256k1 < T > ,
463
+ & self , params : BlindedPathParams , recipient : PublicKey , context : MessageContext , peers : Vec < MessageForwardNode > , secp_ctx : & Secp256k1 < T > ,
464
464
) -> Result < Vec < BlindedMessagePath > , ( ) > ;
465
-
466
- /// Creates compact [`BlindedMessagePath`]s to the `recipient` node. The nodes in `peers` are
467
- /// assumed to be direct peers with the `recipient`.
468
- ///
469
- /// Compact blinded paths use short channel ids instead of pubkeys for a smaller serialization,
470
- /// which is beneficial when a QR code is used to transport the data. The SCID is passed using
471
- /// a [`MessageForwardNode`] but may be `None` for graceful degradation.
472
- ///
473
- /// Implementations using additional intermediate nodes are responsible for using a
474
- /// [`MessageForwardNode`] with `Some` short channel id, if possible. Similarly, implementations
475
- /// should call [`BlindedMessagePath::use_compact_introduction_node`].
476
- ///
477
- /// The provided implementation simply delegates to [`MessageRouter::create_blinded_paths`],
478
- /// ignoring the short channel ids.
479
- fn create_compact_blinded_paths <
480
- T : secp256k1:: Signing + secp256k1:: Verification
481
- > (
482
- & self , recipient : PublicKey , context : MessageContext ,
483
- peers : Vec < MessageForwardNode > , secp_ctx : & Secp256k1 < T > ,
484
- ) -> Result < Vec < BlindedMessagePath > , ( ) > {
485
- let peers = peers
486
- . into_iter ( )
487
- . map ( |MessageForwardNode { node_id, short_channel_id : _ } | node_id)
488
- . collect ( ) ;
489
-
490
- // This parameter is a placeholder. This function is removed in the subsequent commits.
491
- let params = BlindedPathParams {
492
- paths : PATHS_PLACEHOLDER ,
493
- is_compact : true ,
494
- } ;
495
- self . create_blinded_paths ( params, recipient, context, peers, secp_ctx)
496
- }
497
465
}
498
466
499
467
/// A [`MessageRouter`] that can only route to a directly connected [`Destination`].
@@ -627,24 +595,8 @@ where
627
595
T : secp256k1:: Signing + secp256k1:: Verification
628
596
> (
629
597
params : BlindedPathParams , network_graph : & G , recipient : PublicKey , context : MessageContext ,
630
- peers : Vec < PublicKey > , entropy_source : & ES , secp_ctx : & Secp256k1 < T > ,
631
- ) -> Result < Vec < BlindedMessagePath > , ( ) > {
632
- let peers = peers
633
- . into_iter ( )
634
- . map ( |node_id| MessageForwardNode { node_id, short_channel_id : None } ) ;
635
- Self :: create_blinded_paths_from_iter ( params, network_graph, recipient, context, peers. into_iter ( ) , entropy_source, secp_ctx)
636
- }
637
-
638
- pub ( crate ) fn create_compact_blinded_paths <
639
- T : secp256k1:: Signing + secp256k1:: Verification
640
- > (
641
- network_graph : & G , recipient : PublicKey , context : MessageContext ,
642
598
peers : Vec < MessageForwardNode > , entropy_source : & ES , secp_ctx : & Secp256k1 < T > ,
643
599
) -> Result < Vec < BlindedMessagePath > , ( ) > {
644
- let params = BlindedPathParams {
645
- paths : PATHS_PLACEHOLDER ,
646
- is_compact : true ,
647
- } ;
648
600
Self :: create_blinded_paths_from_iter ( params, network_graph, recipient, context, peers. into_iter ( ) , entropy_source, secp_ctx)
649
601
}
650
602
}
@@ -663,19 +615,10 @@ where
663
615
fn create_blinded_paths <
664
616
T : secp256k1:: Signing + secp256k1:: Verification
665
617
> (
666
- & self , params : BlindedPathParams , recipient : PublicKey , context : MessageContext , peers : Vec < PublicKey > , secp_ctx : & Secp256k1 < T > ,
618
+ & self , params : BlindedPathParams , recipient : PublicKey , context : MessageContext , peers : Vec < MessageForwardNode > , secp_ctx : & Secp256k1 < T > ,
667
619
) -> Result < Vec < BlindedMessagePath > , ( ) > {
668
620
Self :: create_blinded_paths ( params, & self . network_graph , recipient, context, peers, & self . entropy_source , secp_ctx)
669
621
}
670
-
671
- fn create_compact_blinded_paths <
672
- T : secp256k1:: Signing + secp256k1:: Verification
673
- > (
674
- & self , recipient : PublicKey , context : MessageContext , peers : Vec < MessageForwardNode > , secp_ctx : & Secp256k1 < T > ,
675
- ) -> Result < Vec < BlindedMessagePath > , ( ) > {
676
- Self :: create_compact_blinded_paths ( & self . network_graph , recipient, context, peers, & self . entropy_source , secp_ctx)
677
- }
678
-
679
622
}
680
623
681
624
/// A path for sending an [`OnionMessage`].
@@ -1270,7 +1213,7 @@ where
1270
1213
let peers = self . message_recipients . lock ( ) . unwrap ( )
1271
1214
. iter ( )
1272
1215
. filter ( |( _, peer) | matches ! ( peer, OnionMessageRecipient :: ConnectedPeer ( _) ) )
1273
- . map ( |( node_id, _ ) | * node_id)
1216
+ . map ( |( node_id, _) | MessageForwardNode { node_id : * node_id, short_channel_id : None } )
1274
1217
. collect :: < Vec < _ > > ( ) ;
1275
1218
1276
1219
self . message_router
0 commit comments