|
76 | 76 | //! # impl Router for FakeRouter {
|
77 | 77 | //! # fn find_route(
|
78 | 78 | //! # &self, payer: &PublicKey, params: &RouteParameters,
|
79 |
| -//! # first_hops: Option<&[&ChannelDetails]>, _inflight_htlcs: InFlightHtlcs |
| 79 | +//! # first_hops: Option<&[&ChannelDetails]>, _inflight_htlcs: &InFlightHtlcs |
80 | 80 | //! # ) -> Result<Route, LightningError> { unimplemented!() }
|
81 | 81 | //! # fn notify_payment_path_failed(&self, path: &[&RouteHop], short_channel_id: u64) { unimplemented!() }
|
82 | 82 | //! # fn notify_payment_path_successful(&self, path: &[&RouteHop]) { unimplemented!() }
|
@@ -510,7 +510,7 @@ where
|
510 | 510 | let first_hops = self.payer.first_hops();
|
511 | 511 | let inflight_htlcs = self.payer.inflight_htlcs();
|
512 | 512 | let route = self.router.find_route(
|
513 |
| - &payer, ¶ms, Some(&first_hops.iter().collect::<Vec<_>>()), inflight_htlcs |
| 513 | + &payer, ¶ms, Some(&first_hops.iter().collect::<Vec<_>>()), &inflight_htlcs |
514 | 514 | ).map_err(|e| PaymentError::Routing(e))?;
|
515 | 515 |
|
516 | 516 | match send_payment(&route) {
|
@@ -578,7 +578,7 @@ where
|
578 | 578 | let inflight_htlcs = self.payer.inflight_htlcs();
|
579 | 579 |
|
580 | 580 | let route = self.router.find_route(
|
581 |
| - &payer, ¶ms, Some(&first_hops.iter().collect::<Vec<_>>()), inflight_htlcs |
| 581 | + &payer, ¶ms, Some(&first_hops.iter().collect::<Vec<_>>()), &inflight_htlcs |
582 | 582 | );
|
583 | 583 |
|
584 | 584 | if route.is_err() {
|
@@ -1670,7 +1670,7 @@ mod tests {
|
1670 | 1670 | impl Router for TestRouter {
|
1671 | 1671 | fn find_route(
|
1672 | 1672 | &self, payer: &PublicKey, route_params: &RouteParameters,
|
1673 |
| - _first_hops: Option<&[&ChannelDetails]>, inflight_htlcs: InFlightHtlcs |
| 1673 | + _first_hops: Option<&[&ChannelDetails]>, inflight_htlcs: &InFlightHtlcs |
1674 | 1674 | ) -> Result<Route, LightningError> {
|
1675 | 1675 | // Simulate calling the Scorer just as you would in find_route
|
1676 | 1676 | let route = Self::route_for_value(route_params.final_value_msat);
|
@@ -1723,7 +1723,7 @@ mod tests {
|
1723 | 1723 | impl Router for FailingRouter {
|
1724 | 1724 | fn find_route(
|
1725 | 1725 | &self, _payer: &PublicKey, _params: &RouteParameters, _first_hops: Option<&[&ChannelDetails]>,
|
1726 |
| - _inflight_htlcs: InFlightHtlcs, |
| 1726 | + _inflight_htlcs: &InFlightHtlcs, |
1727 | 1727 | ) -> Result<Route, LightningError> {
|
1728 | 1728 | Err(LightningError { err: String::new(), action: ErrorAction::IgnoreError })
|
1729 | 1729 | }
|
@@ -2011,7 +2011,7 @@ mod tests {
|
2011 | 2011 | impl Router for ManualRouter {
|
2012 | 2012 | fn find_route(
|
2013 | 2013 | &self, _payer: &PublicKey, _params: &RouteParameters, _first_hops: Option<&[&ChannelDetails]>,
|
2014 |
| - _inflight_htlcs: InFlightHtlcs |
| 2014 | + _inflight_htlcs: &InFlightHtlcs |
2015 | 2015 | ) -> Result<Route, LightningError> {
|
2016 | 2016 | self.0.borrow_mut().pop_front().unwrap()
|
2017 | 2017 | }
|
|
0 commit comments