X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=ldk-sample;a=blobdiff_plain;f=src%2Fmain.rs;fp=src%2Fmain.rs;h=ffe0e69c4595c3d4067ef6336df2d8669da5e3a4;hp=69f0981ca4091403f827f5861258166a2087c5ce;hb=44b7ad33748d85d885e2876d5afc255791523d3f;hpb=da2cd163e859532afedf32719ae7e19ae852680d diff --git a/src/main.rs b/src/main.rs index 69f0981..ffe0e69 100644 --- a/src/main.rs +++ b/src/main.rs @@ -218,8 +218,7 @@ async fn handle_ldk_events( } => { println!( "\nEVENT: received payment from payment hash {} of {} millisatoshis", - hex_utils::hex_str(&payment_hash.0), - amount_msat, + payment_hash, amount_msat, ); print!("> "); io::stdout().flush().unwrap(); @@ -239,8 +238,7 @@ async fn handle_ldk_events( } => { println!( "\nEVENT: claimed payment from payment hash {} of {} millisatoshis", - hex_utils::hex_str(&payment_hash.0), - amount_msat, + payment_hash, amount_msat, ); print!("> "); io::stdout().flush().unwrap(); @@ -277,15 +275,15 @@ async fn handle_ldk_events( payment.status = HTLCStatus::Succeeded; println!( "\nEVENT: successfully sent payment of {} millisatoshis{} from \ - payment hash {:?} with preimage {:?}", + 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) + payment_hash, + payment_preimage ); print!("> "); io::stdout().flush().unwrap(); @@ -328,8 +326,8 @@ async fn handle_ldk_events( Event::ProbeFailed { .. } => {} Event::PaymentFailed { payment_hash, reason, .. } => { print!( - "\nEVENT: Failed to send payment to payment hash {:?}: {:?}", - hex_utils::hex_str(&payment_hash.0), + "\nEVENT: Failed to send payment to payment hash {}: {:?}", + payment_hash, if let Some(r) = reason { r } else { PaymentFailureReason::RetriesExhausted } ); print!("> ");