@@ -503,16 +503,15 @@ pub trait SimNetwork: Send + Sync {
503503type LdkNetworkGraph = NetworkGraph < & ' static WrappedLog > ;
504504/// A trait for custom pathfinding implementations.
505505/// Finds a route from the source node to the destination node for the specified amount.
506- ///
506+ ///
507507/// # Arguments
508508/// * `source` - The public key of the node initiating the payment.
509509/// * `dest` - The public key of the destination node to receive the payment.
510510/// * `amount_msat` - The amount to send in millisatoshis.
511511/// * `pathfinding_graph` - The network graph containing channel topology and routing information.
512- ///
512+ ///
513513/// # Returns
514514/// Returns a `Route` containing the payment path, or a `SimulationError` if no route is found.
515-
516515pub trait PathFinder : Send + Sync + Clone {
517516 fn find_route (
518517 & self ,
@@ -664,37 +663,6 @@ impl<T: SimNetwork, C: Clock, P: PathFinder> SimNode<T, C, P> {
664663
665664 Ok ( ( ) )
666665 }
667-
668- /// Dispatches a payment to a specified route.
669- /// The [`lightning::routing::router::build_route_from_hops`] function can be used to build the route to be passed here.
670- ///
671- /// **Note:** The payment hash passed in here should be used in track_payment to track the payment outcome.
672- pub async fn send_to_route (
673- & mut self ,
674- route : Route ,
675- payment_hash : PaymentHash ,
676- ) -> Result < ( ) , LightningError > {
677- let ( sender, receiver) = channel ( ) ;
678-
679- // Check for payment hash collision, failing the payment if we happen to repeat one.
680- match self . in_flight . entry ( payment_hash) {
681- Entry :: Occupied ( _) => {
682- return Err ( LightningError :: SendPaymentError (
683- "payment hash exists" . to_string ( ) ,
684- ) ) ;
685- } ,
686- Entry :: Vacant ( vacant) => {
687- vacant. insert ( receiver) ;
688- } ,
689- }
690-
691- self . network
692- . lock ( )
693- . await
694- . dispatch_payment ( self . info . pubkey , route, payment_hash, sender) ;
695-
696- Ok ( ( ) )
697- }
698666}
699667
700668/// Produces the node info for a mocked node, filling in the features that the simulator requires.
@@ -2238,19 +2206,6 @@ mod tests {
22382206 populate_network_graph ( channels. clone ( ) , Arc :: new ( SystemClock { } ) ) . unwrap ( ) ,
22392207 ) ;
22402208
2241- <<<<<<< HEAD
2242- let scorer = Mutex :: new ( ProbabilisticScorer :: new (
2243- =======
2244- <<<<<<< HEAD
2245- let scorer = ProbabilisticScorer :: new (
2246- >>>>>>> 4 a0f276 ( Remove LDK specific scoring from PathFinder trait)
2247- ProbabilisticScoringDecayParameters :: default ( ) ,
2248- routing_graph . clone( ) ,
2249- Arc :: new( WrappedLog { } ) ,
2250- ) ) ;
2251-
2252- =======
2253- >>>>>>> 3 e72658 ( Remove LDK specific scoring from PathFinder trait )
22542209 // Collect pubkeys in-order, pushing the last node on separately because they don't have an outgoing
22552210 // channel (they are not node_1 in any channel, only node_2).
22562211 let mut nodes = channels
@@ -2523,6 +2478,7 @@ mod tests {
25232478 Arc :: new ( Mutex :: new ( test_kit. graph ) ) ,
25242479 test_kit. routing_graph . clone ( ) ,
25252480 Arc :: new ( SystemClock { } ) ,
2481+ test_kit. pathfinder . clone ( ) ,
25262482 )
25272483 . unwrap ( ) ;
25282484
0 commit comments