X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning-invoice%2Fsrc%2Fpayment.rs;h=9fb472d3b311fbc872bdab4d5c74455a4f4e6857;hb=cb952f651ffbe79337f857940723ae5b2fcbc408;hp=03dc9361f7e4fecf827b9878c569bb412a8c163f;hpb=9449d042b985553e6b06761d4a64df16f8bd12ad;p=rust-lightning diff --git a/lightning-invoice/src/payment.rs b/lightning-invoice/src/payment.rs index 03dc9361..9fb472d3 100644 --- a/lightning-invoice/src/payment.rs +++ b/lightning-invoice/src/payment.rs @@ -76,7 +76,7 @@ //! # impl Router for FakeRouter { //! # fn find_route( //! # &self, payer: &PublicKey, params: &RouteParameters, -//! # first_hops: Option<&[&ChannelDetails]>, _inflight_htlcs: InFlightHtlcs +//! # first_hops: Option<&[&ChannelDetails]>, _inflight_htlcs: &InFlightHtlcs //! # ) -> Result { unimplemented!() } //! # fn notify_payment_path_failed(&self, path: &[&RouteHop], short_channel_id: u64) { unimplemented!() } //! # fn notify_payment_path_successful(&self, path: &[&RouteHop]) { unimplemented!() } @@ -510,7 +510,7 @@ where let first_hops = self.payer.first_hops(); let inflight_htlcs = self.payer.inflight_htlcs(); let route = self.router.find_route( - &payer, ¶ms, Some(&first_hops.iter().collect::>()), inflight_htlcs + &payer, ¶ms, Some(&first_hops.iter().collect::>()), &inflight_htlcs ).map_err(|e| PaymentError::Routing(e))?; match send_payment(&route) { @@ -578,7 +578,7 @@ where let inflight_htlcs = self.payer.inflight_htlcs(); let route = self.router.find_route( - &payer, ¶ms, Some(&first_hops.iter().collect::>()), inflight_htlcs + &payer, ¶ms, Some(&first_hops.iter().collect::>()), &inflight_htlcs ); if route.is_err() { @@ -1670,7 +1670,7 @@ mod tests { impl Router for TestRouter { fn find_route( &self, payer: &PublicKey, route_params: &RouteParameters, - _first_hops: Option<&[&ChannelDetails]>, inflight_htlcs: InFlightHtlcs + _first_hops: Option<&[&ChannelDetails]>, inflight_htlcs: &InFlightHtlcs ) -> Result { // Simulate calling the Scorer just as you would in find_route let route = Self::route_for_value(route_params.final_value_msat); @@ -1723,7 +1723,7 @@ mod tests { impl Router for FailingRouter { fn find_route( &self, _payer: &PublicKey, _params: &RouteParameters, _first_hops: Option<&[&ChannelDetails]>, - _inflight_htlcs: InFlightHtlcs, + _inflight_htlcs: &InFlightHtlcs, ) -> Result { Err(LightningError { err: String::new(), action: ErrorAction::IgnoreError }) } @@ -2011,7 +2011,7 @@ mod tests { impl Router for ManualRouter { fn find_route( &self, _payer: &PublicKey, _params: &RouteParameters, _first_hops: Option<&[&ChannelDetails]>, - _inflight_htlcs: InFlightHtlcs + _inflight_htlcs: &InFlightHtlcs ) -> Result { self.0.borrow_mut().pop_front().unwrap() }