Skip to content

Commit

Permalink
logs
Browse files Browse the repository at this point in the history
  • Loading branch information
benthecarman committed Nov 21, 2024
1 parent 16f0571 commit 373f5d7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/lightning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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(),
Expand Down
3 changes: 2 additions & 1 deletion src/nostr_dms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ 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,
Expand Down
5 changes: 3 additions & 2 deletions src/onchain.rs
Original file line number Diff line number Diff line change
@@ -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<u64>,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 373f5d7

Please sign in to comment.