Switch keysend command to using InvoicePayer to get retries
[ldk-sample] / src / main.rs
index 343c2d5356f3457c8f9372b1f54718a5ae8ea38e..3959386fd15c5559a413111c8089c3c7edeb05a5 100644 (file)
@@ -195,16 +195,21 @@ async fn handle_ldk_events(
                                }
                        }
                }
-               Event::PaymentSent { payment_preimage, payment_hash, .. } => {
+               Event::PaymentSent { payment_preimage, payment_hash, fee_paid_msat, .. } => {
                        let mut payments = outbound_payments.lock().unwrap();
                        for (hash, payment) in payments.iter_mut() {
                                if *hash == *payment_hash {
                                        payment.preimage = Some(*payment_preimage);
                                        payment.status = HTLCStatus::Succeeded;
                                        println!(
-                                               "\nEVENT: successfully sent payment of {} millisatoshis from \
+                                               "\nEVENT: successfully sent payment of {} millisatoshis{} from \
                                                                 payment hash {:?} with preimage {:?}",
                                                payment.amt_msat,
+                                               if let Some(fee) = fee_paid_msat {
+                                                       format!(" (fee {} msat)", fee)
+                                               } else {
+                                                       "".to_string()
+                                               },
                                                hex_utils::hex_str(&payment_hash.0),
                                                hex_utils::hex_str(&payment_preimage.0)
                                        );
@@ -688,12 +693,9 @@ async fn start_ldk() {
                peer_manager.clone(),
                channel_manager.clone(),
                keys_manager.clone(),
-               network_graph.clone(),
-               scorer.clone(),
                inbound_payments,
                outbound_payments,
                ldk_data_dir.clone(),
-               logger.clone(),
                network,
        )
        .await;