X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fcli.rs;h=7e122c39a2b6a402802b95a56fc2eb0a6ea59280;hb=c3ed7ce32015e718f87d2a018eabddfb5fa4599b;hp=5d778e8754975f085d10605c047c37abf4387596;hpb=1cf16ecbc0787d3767374399f5494e3b882390c3;p=ldk-sample diff --git a/src/cli.rs b/src/cli.rs index 5d778e8..7e122c3 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -13,7 +13,7 @@ use lightning::ln::msgs::NetAddress; use lightning::ln::{PaymentHash, PaymentSecret}; use lightning::routing::network_graph::NetGraphMsgHandler; use lightning::routing::router; -use lightning::routing::router::RouteHintHop; +use lightning::routing::router::RouteHint; use lightning::util::config::UserConfig; use lightning_invoice::{utils, Currency, Invoice}; use std::env; @@ -227,11 +227,7 @@ pub(crate) async fn poll_for_user_input( continue; } }; - let mut route_hints = invoice.routes().clone(); - let mut last_hops = Vec::new(); - for hint in route_hints.drain(..) { - last_hops.push(hint[hint.len() - 1].clone()); - } + let last_hops = invoice.route_hints(); let amt_pico_btc = invoice.amount_pico_btc(); if amt_pico_btc.is_none() { @@ -541,7 +537,7 @@ fn open_channel( fn send_payment( payee: PublicKey, amt_msat: u64, final_cltv: u32, payment_hash: PaymentHash, payment_secret: Option, payee_features: Option, - route_hints: Vec, + route_hints: Vec<&RouteHint>, router: Arc, Arc>>, channel_manager: Arc, payment_storage: PaymentInfoStorage, logger: Arc, @@ -556,7 +552,7 @@ fn send_payment( &payee, payee_features, Some(&first_hops.iter().collect::>()), - &route_hints.iter().collect::>(), + &route_hints, amt_msat, final_cltv, logger,