@@ -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
/// # }
@@ -475,36 +475,8 @@ pub trait MessageRouter {
475
475
fn create_blinded_paths <
476
476
T : secp256k1:: Signing + secp256k1:: Verification
477
477
> (
478
- & self , params : BlindedPathParams , recipient : PublicKey , context : MessageContext , peers : Vec < PublicKey > , secp_ctx : & Secp256k1 < T > ,
478
+ & self , params : BlindedPathParams , recipient : PublicKey , context : MessageContext , peers : Vec < MessageForwardNode > , secp_ctx : & Secp256k1 < T > ,
479
479
) -> Result < Vec < BlindedMessagePath > , ( ) > ;
480
-
481
- /// Creates compact [`BlindedMessagePath`]s to the `recipient` node. The nodes in `peers` are
482
- /// assumed to be direct peers with the `recipient`.
483
- ///
484
- /// Compact blinded paths use short channel ids instead of pubkeys for a smaller serialization,
485
- /// which is beneficial when a QR code is used to transport the data. The SCID is passed using
486
- /// a [`MessageForwardNode`] but may be `None` for graceful degradation.
487
- ///
488
- /// Implementations using additional intermediate nodes are responsible for using a
489
- /// [`MessageForwardNode`] with `Some` short channel id, if possible. Similarly, implementations
490
- /// should call [`BlindedMessagePath::use_compact_introduction_node`].
491
- ///
492
- /// The provided implementation simply delegates to [`MessageRouter::create_blinded_paths`],
493
- /// ignoring the short channel ids.
494
- fn create_compact_blinded_paths <
495
- T : secp256k1:: Signing + secp256k1:: Verification
496
- > (
497
- & self , recipient : PublicKey , context : MessageContext ,
498
- peers : Vec < MessageForwardNode > , secp_ctx : & Secp256k1 < T > ,
499
- ) -> Result < Vec < BlindedMessagePath > , ( ) > {
500
- let peers = peers
501
- . into_iter ( )
502
- . map ( |MessageForwardNode { node_id, short_channel_id : _ } | node_id)
503
- . collect ( ) ;
504
-
505
- let params = BlindedPathParams :: new ( true ) ;
506
- self . create_blinded_paths ( params, recipient, context, peers, secp_ctx)
507
- }
508
480
}
509
481
510
482
/// A [`MessageRouter`] that can only route to a directly connected [`Destination`].
@@ -638,21 +610,8 @@ where
638
610
T : secp256k1:: Signing + secp256k1:: Verification
639
611
> (
640
612
params : BlindedPathParams , network_graph : & G , recipient : PublicKey , context : MessageContext ,
641
- peers : Vec < PublicKey > , entropy_source : & ES , secp_ctx : & Secp256k1 < T > ,
642
- ) -> Result < Vec < BlindedMessagePath > , ( ) > {
643
- let peers = peers
644
- . into_iter ( )
645
- . map ( |node_id| MessageForwardNode { node_id, short_channel_id : None } ) ;
646
- Self :: create_blinded_paths_from_iter ( params, network_graph, recipient, context, peers. into_iter ( ) , entropy_source, secp_ctx)
647
- }
648
-
649
- pub ( crate ) fn create_compact_blinded_paths <
650
- T : secp256k1:: Signing + secp256k1:: Verification
651
- > (
652
- network_graph : & G , recipient : PublicKey , context : MessageContext ,
653
613
peers : Vec < MessageForwardNode > , entropy_source : & ES , secp_ctx : & Secp256k1 < T > ,
654
614
) -> Result < Vec < BlindedMessagePath > , ( ) > {
655
- let params = BlindedPathParams :: new ( true ) ;
656
615
Self :: create_blinded_paths_from_iter ( params, network_graph, recipient, context, peers. into_iter ( ) , entropy_source, secp_ctx)
657
616
}
658
617
}
@@ -671,19 +630,10 @@ where
671
630
fn create_blinded_paths <
672
631
T : secp256k1:: Signing + secp256k1:: Verification
673
632
> (
674
- & self , params : BlindedPathParams , recipient : PublicKey , context : MessageContext , peers : Vec < PublicKey > , secp_ctx : & Secp256k1 < T > ,
633
+ & self , params : BlindedPathParams , recipient : PublicKey , context : MessageContext , peers : Vec < MessageForwardNode > , secp_ctx : & Secp256k1 < T > ,
675
634
) -> Result < Vec < BlindedMessagePath > , ( ) > {
676
635
Self :: create_blinded_paths ( params, & self . network_graph , recipient, context, peers, & self . entropy_source , secp_ctx)
677
636
}
678
-
679
- fn create_compact_blinded_paths <
680
- T : secp256k1:: Signing + secp256k1:: Verification
681
- > (
682
- & self , recipient : PublicKey , context : MessageContext , peers : Vec < MessageForwardNode > , secp_ctx : & Secp256k1 < T > ,
683
- ) -> Result < Vec < BlindedMessagePath > , ( ) > {
684
- Self :: create_compact_blinded_paths ( & self . network_graph , recipient, context, peers, & self . entropy_source , secp_ctx)
685
- }
686
-
687
637
}
688
638
689
639
/// A path for sending an [`OnionMessage`].
@@ -1275,7 +1225,7 @@ where
1275
1225
let peers = self . message_recipients . lock ( ) . unwrap ( )
1276
1226
. iter ( )
1277
1227
. filter ( |( _, peer) | matches ! ( peer, OnionMessageRecipient :: ConnectedPeer ( _) ) )
1278
- . map ( |( node_id, _ ) | * node_id)
1228
+ . map ( |( node_id, _) | MessageForwardNode { node_id : * node_id, short_channel_id : None } )
1279
1229
. collect :: < Vec < _ > > ( ) ;
1280
1230
1281
1231
self . message_router
0 commit comments