1212use bitcoin:: secp256k1:: { PublicKey , Secp256k1 , self } ;
1313
1414use crate :: blinded_path:: { BlindedHop , Direction , IntroductionNode } ;
15- use crate :: blinded_path:: message:: { BlindedMessagePath , MessageContext , MessageForwardNode } ;
1615use crate :: blinded_path:: payment:: { BlindedPaymentPath , ForwardTlvs , PaymentConstraints , PaymentForwardNode , PaymentRelay , ReceiveTlvs } ;
1716use crate :: ln:: { PaymentHash , PaymentPreimage } ;
1817use crate :: ln:: channel_state:: ChannelDetails ;
@@ -23,7 +22,6 @@ use crate::ln::onion_utils;
2322#[ cfg( async_payments) ]
2423use crate :: offers:: static_invoice:: StaticInvoice ;
2524use crate :: offers:: invoice:: Bolt12Invoice ;
26- use crate :: onion_message:: messenger:: { DefaultMessageRouter , Destination , MessageRouter , OnionMessagePath } ;
2725use crate :: routing:: gossip:: { DirectedChannelInfo , EffectiveCapacity , ReadOnlyNetworkGraph , NetworkGraph , NodeId } ;
2826use crate :: routing:: scoring:: { ChannelUsage , LockableScore , ScoreLookUp } ;
2927use crate :: sign:: EntropySource ;
@@ -49,9 +47,6 @@ pub use lightning_types::routing::{RouteHint, RouteHintHop};
4947/// it will create a one-hop path using the recipient as the introduction node if it is a announced
5048/// node. Otherwise, there is no way to find a path to the introduction node in order to send a
5149/// payment, and thus an `Err` is returned.
52- ///
53- /// Implements [`MessageRouter`] by delegating to [`DefaultMessageRouter`]. See those docs for
54- /// privacy implications.
5550pub struct DefaultRouter < G : Deref < Target = NetworkGraph < L > > , L : Deref , ES : Deref , S : Deref , SP : Sized , Sc : ScoreLookUp < ScoreParams = SP > > where
5651 L :: Target : Logger ,
5752 S :: Target : for < ' a > LockableScore < ' a , ScoreLookUp = Sc > ,
@@ -190,36 +185,8 @@ impl<G: Deref<Target = NetworkGraph<L>>, L: Deref, ES: Deref, S: Deref, SP: Size
190185 }
191186}
192187
193- impl < G : Deref < Target = NetworkGraph < L > > , L : Deref , ES : Deref , S : Deref , SP : Sized , Sc : ScoreLookUp < ScoreParams = SP > > MessageRouter for DefaultRouter < G , L , ES , S , SP , Sc > where
194- L :: Target : Logger ,
195- S :: Target : for < ' a > LockableScore < ' a , ScoreLookUp = Sc > ,
196- ES :: Target : EntropySource ,
197- {
198- fn find_path (
199- & self , sender : PublicKey , peers : Vec < PublicKey > , destination : Destination
200- ) -> Result < OnionMessagePath , ( ) > {
201- DefaultMessageRouter :: < _ , _ , ES > :: find_path ( & self . network_graph , sender, peers, destination)
202- }
203-
204- fn create_blinded_paths <
205- T : secp256k1:: Signing + secp256k1:: Verification
206- > (
207- & self , recipient : PublicKey , context : MessageContext , peers : Vec < PublicKey > , secp_ctx : & Secp256k1 < T > ,
208- ) -> Result < Vec < BlindedMessagePath > , ( ) > {
209- DefaultMessageRouter :: create_blinded_paths ( & self . network_graph , recipient, context, peers, & self . entropy_source , secp_ctx)
210- }
211-
212- fn create_compact_blinded_paths <
213- T : secp256k1:: Signing + secp256k1:: Verification
214- > (
215- & self , recipient : PublicKey , context : MessageContext , peers : Vec < MessageForwardNode > , secp_ctx : & Secp256k1 < T > ,
216- ) -> Result < Vec < BlindedMessagePath > , ( ) > {
217- DefaultMessageRouter :: create_compact_blinded_paths ( & self . network_graph , recipient, context, peers, & self . entropy_source , secp_ctx)
218- }
219- }
220-
221188/// A trait defining behavior for routing a payment.
222- pub trait Router : MessageRouter {
189+ pub trait Router {
223190 /// Finds a [`Route`] for a payment between the given `payer` and a payee.
224191 ///
225192 /// The `payee` and the payment's value are given in [`RouteParameters::payment_params`]
0 commit comments