@@ -16,6 +16,7 @@ use lightning::routing::network_graph::{NetGraphMsgHandler, RoutingFees};
16
16
use lightning:: routing:: router;
17
17
use lightning:: routing:: router:: RouteHint ;
18
18
use lightning:: util:: config:: UserConfig ;
19
+ use lightning_invoice:: { Currency , Invoice , InvoiceBuilder , Route , RouteHop } ;
19
20
use rand;
20
21
use rand:: Rng ;
21
22
use std:: env;
@@ -194,15 +195,15 @@ pub(crate) async fn poll_for_user_input(
194
195
continue ;
195
196
}
196
197
197
- let invoice_res = lightning_invoice :: Invoice :: from_str ( invoice_str. unwrap ( ) ) ;
198
+ let invoice_res = Invoice :: from_str ( invoice_str. unwrap ( ) ) ;
198
199
if invoice_res. is_err ( ) {
199
200
println ! ( "ERROR: invalid invoice: {:?}" , invoice_res. unwrap_err( ) ) ;
200
201
print ! ( "> " ) ;
201
202
io:: stdout ( ) . flush ( ) . unwrap ( ) ;
202
203
continue ;
203
204
}
204
205
let invoice = invoice_res. unwrap ( ) ;
205
- let route_hints: Vec < lightning_invoice :: Route > =
206
+ let route_hints: Vec < Route > =
206
207
invoice. routes ( ) . iter ( ) . map ( |& route| route. clone ( ) ) . collect ( ) ;
207
208
208
209
let amt_pico_btc = invoice. amount_pico_btc ( ) ;
@@ -522,7 +523,7 @@ fn open_channel(
522
523
fn send_payment (
523
524
payee : PublicKey , amt_msat : u64 , final_cltv : u32 , payment_hash : PaymentHash ,
524
525
payment_secret : Option < PaymentSecret > , payee_features : Option < InvoiceFeatures > ,
525
- mut route_hints : Vec < lightning_invoice :: Route > ,
526
+ mut route_hints : Vec < Route > ,
526
527
router : Arc < NetGraphMsgHandler < Arc < dyn chain:: Access > , Arc < FilesystemLogger > > > ,
527
528
channel_manager : Arc < ChannelManager > , payment_storage : PaymentInfoStorage ,
528
529
logger : Arc < FilesystemLogger > ,
@@ -597,10 +598,10 @@ fn get_invoice(
597
598
let payment_hash = Sha256Hash :: hash ( & preimage) ;
598
599
599
600
let our_node_pubkey = channel_manager. get_our_node_id ( ) ;
600
- let mut invoice = lightning_invoice :: InvoiceBuilder :: new ( match network {
601
- Network :: Bitcoin => lightning_invoice :: Currency :: Bitcoin ,
602
- Network :: Testnet => lightning_invoice :: Currency :: BitcoinTestnet ,
603
- Network :: Regtest => lightning_invoice :: Currency :: Regtest ,
601
+ let mut invoice = InvoiceBuilder :: new ( match network {
602
+ Network :: Bitcoin => Currency :: Bitcoin ,
603
+ Network :: Testnet => Currency :: BitcoinTestnet ,
604
+ Network :: Regtest => Currency :: Regtest ,
604
605
Network :: Signet => panic ! ( "Signet invoices not supported" ) ,
605
606
} )
606
607
. payment_hash ( payment_hash)
@@ -624,7 +625,7 @@ fn get_invoice(
624
625
if forwarding_info. cltv_expiry_delta > min_final_cltv_expiry {
625
626
min_final_cltv_expiry = forwarding_info. cltv_expiry_delta ;
626
627
}
627
- invoice = invoice. route ( vec ! [ lightning_invoice :: RouteHop {
628
+ invoice = invoice. route ( vec ! [ RouteHop {
628
629
pubkey: channel. remote_network_id,
629
630
short_channel_id,
630
631
fee_base_msat: forwarding_info. fee_base_msat,
0 commit comments