Skip to content

Commit 46606e9

Browse files
committed
Fixup rebase
1 parent 3e72658 commit 46606e9

File tree

1 file changed

+2
-32
lines changed

1 file changed

+2
-32
lines changed

simln-lib/src/sim_node.rs

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ impl PathFinder for DefaultPathFinder {
567567
/// all functionality through to a coordinating simulation network. This implementation contains both the [`SimNetwork`]
568568
/// implementation that will allow us to dispatch payments and a read-only NetworkGraph that is used for pathfinding.
569569
/// While these two could be combined, we re-use the LDK-native struct to allow re-use of their pathfinding logic.
570-
pub struct SimNode<'a, T: SimNetwork, P: PathFinder<'a> = DefaultPathFinder> {
570+
pub struct SimNode<T: SimNetwork, P: PathFinder = DefaultPathFinder> {
571571
info: NodeInfo,
572572
/// The underlying execution network that will be responsible for dispatching payments.
573573
network: Arc<Mutex<T>>,
@@ -627,37 +627,6 @@ impl<T: SimNetwork, P: PathFinder> SimNode<T, P> {
627627

628628
Ok(())
629629
}
630-
631-
/// Dispatches a payment to a specified route.
632-
/// The [`lightning::routing::router::build_route_from_hops`] function can be used to build the route to be passed here.
633-
///
634-
/// **Note:** The payment hash passed in here should be used in track_payment to track the payment outcome.
635-
pub async fn send_to_route(
636-
&mut self,
637-
route: Route,
638-
payment_hash: PaymentHash,
639-
) -> Result<(), LightningError> {
640-
let (sender, receiver) = channel();
641-
642-
// Check for payment hash collision, failing the payment if we happen to repeat one.
643-
match self.in_flight.entry(payment_hash) {
644-
Entry::Occupied(_) => {
645-
return Err(LightningError::SendPaymentError(
646-
"payment hash exists".to_string(),
647-
));
648-
},
649-
Entry::Vacant(vacant) => {
650-
vacant.insert(receiver);
651-
},
652-
}
653-
654-
self.network
655-
.lock()
656-
.await
657-
.dispatch_payment(self.info.pubkey, route, payment_hash, sender);
658-
659-
Ok(())
660-
}
661630
}
662631

663632
/// Produces the node info for a mocked node, filling in the features that the simulator requires.
@@ -2348,6 +2317,7 @@ mod tests {
23482317
test_kit.nodes[0],
23492318
Arc::new(Mutex::new(test_kit.graph)),
23502319
test_kit.routing_graph.clone(),
2320+
test_kit.pathfinder.clone(),
23512321
);
23522322

23532323
let route = build_route_from_hops(

0 commit comments

Comments
 (0)