- let amt_pico_btc = invoice.amount_pico_btc();
- if amt_pico_btc.is_none() {
- println!("ERROR: invalid invoice: must contain amount to pay");
- print!("> ");
- io::stdout().flush().unwrap();
- continue;
- }
- let amt_msat = amt_pico_btc.unwrap() / 10;
-
- let payee_pubkey = invoice.recover_payee_pub_key();
- let final_cltv = invoice.min_final_cltv_expiry() as u32;
- let payment_hash = PaymentHash(invoice.payment_hash().clone().into_inner());
- let payment_secret = invoice.payment_secret().cloned();
- let invoice_features = invoice.features().cloned();
-
- send_payment(
- payee_pubkey,
- amt_msat,
- final_cltv,
- payment_hash,
- payment_secret,
- invoice_features,
- last_hops,
- router.clone(),
- channel_manager.clone(),
- outbound_payments.clone(),
- logger.clone(),
- );