diff --git a/src/lightning.rs b/src/lightning.rs index fe54bb0..2d0f17e 100644 --- a/src/lightning.rs +++ b/src/lightning.rs @@ -5,6 +5,7 @@ use lightning_invoice::Bolt11Invoice; use lnurl::lightning_address::LightningAddress; use lnurl::lnurl::LnUrl; use lnurl::LnUrlResponse; +use log::info; use nostr::prelude::ZapRequestData; use nostr::{EventBuilder, Filter, JsonUtil, Kind, Metadata, UncheckedUrl}; use std::str::FromStr; @@ -102,6 +103,8 @@ pub async fn pay_lightning( let payment_preimage = { let mut lightning_client = state.lightning_client.clone(); + info!("Paying invoice {invoice}"); + let response = lightning_client .send_payment_sync(lnrpc::SendRequest { payment_request: invoice.to_string(), diff --git a/src/nostr_dms.rs b/src/nostr_dms.rs index e0fc9b4..c529245 100644 --- a/src/nostr_dms.rs +++ b/src/nostr_dms.rs @@ -175,10 +175,12 @@ async fn handle_event(event: Event, state: AppState) -> anyhow::Result<()> { let resp = { let mut wallet_client = state.lightning_client.clone(); - let req = tonic_openssl_lnd::lnrpc::SendCoinsRequest { + info!("Sending {amount} to {address}"); + let req = lnrpc::SendCoinsRequest { addr: address.to_string(), amount: amount.to_sat() as i64, spend_unconfirmed: true, + sat_per_vbyte: 1, ..Default::default() }; wallet_client.send_coins(req).await?.into_inner() diff --git a/src/onchain.rs b/src/onchain.rs index e89c85f..fcb1288 100644 --- a/src/onchain.rs +++ b/src/onchain.rs @@ -1,10 +1,10 @@ +use crate::{AppState, MAX_SEND_AMOUNT}; use bitcoin::{Address, Amount}; use bitcoin_waila::PaymentParams; +use log::info; use serde::{Deserialize, Serialize}; use std::str::FromStr; -use crate::{AppState, MAX_SEND_AMOUNT}; - #[derive(Clone, Deserialize)] pub struct OnchainRequest { sats: Option, @@ -53,6 +53,7 @@ pub async fn pay_onchain( let resp = { let mut wallet_client = state.lightning_client.clone(); + info!("Sending {amount} to {address}"); let req = tonic_openssl_lnd::lnrpc::SendCoinsRequest { addr: address.to_string(), amount: amount.to_sat() as i64,