12
12
use bitcoin:: secp256k1:: { PublicKey , Secp256k1 , self } ;
13
13
14
14
use crate :: blinded_path:: { BlindedHop , Direction , IntroductionNode } ;
15
- use crate :: blinded_path:: message:: { BlindedMessagePath , MessageContext , MessageForwardNode } ;
16
15
use crate :: blinded_path:: payment:: { BlindedPaymentPath , ForwardTlvs , PaymentConstraints , PaymentForwardNode , PaymentRelay , ReceiveTlvs } ;
17
16
use crate :: ln:: { PaymentHash , PaymentPreimage } ;
18
17
use crate :: ln:: channel_state:: ChannelDetails ;
@@ -23,7 +22,6 @@ use crate::ln::onion_utils;
23
22
#[ cfg( async_payments) ]
24
23
use crate :: offers:: static_invoice:: StaticInvoice ;
25
24
use crate :: offers:: invoice:: Bolt12Invoice ;
26
- use crate :: onion_message:: messenger:: { DefaultMessageRouter , Destination , MessageRouter , OnionMessagePath } ;
27
25
use crate :: routing:: gossip:: { DirectedChannelInfo , EffectiveCapacity , ReadOnlyNetworkGraph , NetworkGraph , NodeId } ;
28
26
use crate :: routing:: scoring:: { ChannelUsage , LockableScore , ScoreLookUp } ;
29
27
use crate :: sign:: EntropySource ;
@@ -49,9 +47,6 @@ pub use lightning_types::routing::{RouteHint, RouteHintHop};
49
47
/// it will create a one-hop path using the recipient as the introduction node if it is a announced
50
48
/// node. Otherwise, there is no way to find a path to the introduction node in order to send a
51
49
/// payment, and thus an `Err` is returned.
52
- ///
53
- /// Implements [`MessageRouter`] by delegating to [`DefaultMessageRouter`]. See those docs for
54
- /// privacy implications.
55
50
pub struct DefaultRouter < G : Deref < Target = NetworkGraph < L > > , L : Deref , ES : Deref , S : Deref , SP : Sized , Sc : ScoreLookUp < ScoreParams = SP > > where
56
51
L :: Target : Logger ,
57
52
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
190
185
}
191
186
}
192
187
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
-
221
188
/// A trait defining behavior for routing a payment.
222
- pub trait Router : MessageRouter {
189
+ pub trait Router {
223
190
/// Finds a [`Route`] for a payment between the given `payer` and a payee.
224
191
///
225
192
/// The `payee` and the payment's value are given in [`RouteParameters::payment_params`]
0 commit comments