diff --git a/src/cli.rs b/src/cli.rs index a70d772..04c5898 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -175,8 +175,8 @@ pub(crate) fn poll_for_user_input( } if let Ok(offer) = Offer::from_str(invoice_str.unwrap()) { - let offer_hash = Sha256::hash(invoice_str.unwrap().as_bytes()); - let payment_id = PaymentId(*offer_hash.as_ref()); + let random_bytes = keys_manager.get_secure_random_bytes(); + let payment_id = PaymentId(random_bytes); let amt_msat = match (offer.amount(), user_provided_amt) { (Some(offer::Amount::Bitcoin { amount_msats }), _) => *amount_msats, @@ -818,7 +818,7 @@ fn send_payment( let (payment_hash, recipient_onion, route_params) = match pay_params_opt { Ok(res) => res, Err(e) => { - println!("Failed to parse invoice"); + println!("Failed to parse invoice: {:?}", e); print!("> "); return; }