|
73 | 73 | //! # struct FakeRouter {} |
74 | 74 | //! # impl Router for FakeRouter { |
75 | 75 | //! # fn find_route( |
76 | | -//! # &self, payer: &PublicKey, params: &RouteParameters, payment_hash: &PaymentHash, |
| 76 | +//! # &self, payer: &PublicKey, params: &RouteParameters, |
77 | 77 | //! # first_hops: Option<&[&ChannelDetails]>, _inflight_htlcs: InFlightHtlcs |
78 | 78 | //! # ) -> Result<Route, LightningError> { unimplemented!() } |
79 | 79 | //! # |
@@ -270,7 +270,7 @@ pub trait Payer { |
270 | 270 | pub trait Router { |
271 | 271 | /// Finds a [`Route`] between `payer` and `payee` for a payment with the given values. |
272 | 272 | fn find_route( |
273 | | - &self, payer: &PublicKey, route_params: &RouteParameters, payment_hash: &PaymentHash, |
| 273 | + &self, payer: &PublicKey, route_params: &RouteParameters, |
274 | 274 | first_hops: Option<&[&ChannelDetails]>, inflight_htlcs: InFlightHtlcs |
275 | 275 | ) -> Result<Route, LightningError>; |
276 | 276 | /// Lets the router know that payment through a specific path has failed. |
@@ -447,8 +447,7 @@ where |
447 | 447 | let first_hops = self.payer.first_hops(); |
448 | 448 | let inflight_htlcs = self.create_inflight_map(); |
449 | 449 | let route = self.router.find_route( |
450 | | - &payer, ¶ms, &payment_hash, Some(&first_hops.iter().collect::<Vec<_>>()), |
451 | | - inflight_htlcs |
| 450 | + &payer, ¶ms, Some(&first_hops.iter().collect::<Vec<_>>()), inflight_htlcs |
452 | 451 | ).map_err(|e| PaymentError::Routing(e))?; |
453 | 452 |
|
454 | 453 | match send_payment(&route) { |
@@ -552,8 +551,7 @@ where |
552 | 551 | let inflight_htlcs = self.create_inflight_map(); |
553 | 552 |
|
554 | 553 | let route = self.router.find_route( |
555 | | - &payer, ¶ms, &payment_hash, Some(&first_hops.iter().collect::<Vec<_>>()), |
556 | | - inflight_htlcs |
| 554 | + &payer, ¶ms, Some(&first_hops.iter().collect::<Vec<_>>()), inflight_htlcs |
557 | 555 | ); |
558 | 556 |
|
559 | 557 | if route.is_err() { |
@@ -1812,7 +1810,7 @@ mod tests { |
1812 | 1810 |
|
1813 | 1811 | impl Router for TestRouter { |
1814 | 1812 | fn find_route( |
1815 | | - &self, payer: &PublicKey, route_params: &RouteParameters, _payment_hash: &PaymentHash, |
| 1813 | + &self, payer: &PublicKey, route_params: &RouteParameters, |
1816 | 1814 | _first_hops: Option<&[&ChannelDetails]>, inflight_htlcs: InFlightHtlcs |
1817 | 1815 | ) -> Result<Route, LightningError> { |
1818 | 1816 | // Simulate calling the Scorer just as you would in find_route |
@@ -1865,8 +1863,8 @@ mod tests { |
1865 | 1863 |
|
1866 | 1864 | impl Router for FailingRouter { |
1867 | 1865 | fn find_route( |
1868 | | - &self, _payer: &PublicKey, _params: &RouteParameters, _payment_hash: &PaymentHash, |
1869 | | - _first_hops: Option<&[&ChannelDetails]>, _inflight_htlcs: InFlightHtlcs |
| 1866 | + &self, _payer: &PublicKey, _params: &RouteParameters, _first_hops: Option<&[&ChannelDetails]>, |
| 1867 | + _inflight_htlcs: InFlightHtlcs |
1870 | 1868 | ) -> Result<Route, LightningError> { |
1871 | 1869 | Err(LightningError { err: String::new(), action: ErrorAction::IgnoreError }) |
1872 | 1870 | } |
@@ -2127,8 +2125,8 @@ mod tests { |
2127 | 2125 |
|
2128 | 2126 | impl Router for ManualRouter { |
2129 | 2127 | fn find_route( |
2130 | | - &self, _payer: &PublicKey, _params: &RouteParameters, _payment_hash: &PaymentHash, |
2131 | | - _first_hops: Option<&[&ChannelDetails]>, _inflight_htlcs: InFlightHtlcs |
| 2128 | + &self, _payer: &PublicKey, _params: &RouteParameters, _first_hops: Option<&[&ChannelDetails]>, |
| 2129 | + _inflight_htlcs: InFlightHtlcs |
2132 | 2130 | ) -> Result<Route, LightningError> { |
2133 | 2131 | self.0.borrow_mut().pop_front().unwrap() |
2134 | 2132 | } |
|
0 commit comments