Skip to content

Commit

Permalink
Onchain payment flow: add more logging (#551)
Browse files Browse the repository at this point in the history
  • Loading branch information
ok300 authored Nov 7, 2024
1 parent dee4952 commit 4c2fcf6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/core/src/sdk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,7 @@ impl LiquidSdk {
.all_fees()
.values()
.sum();
info!("Estimated drain tx fee: {fee_sat} sat");

Ok(fee_sat)
}
Expand Down Expand Up @@ -1165,6 +1166,7 @@ impl LiquidSdk {
};
let server_fees_sat = pair.fees.server();

info!("Preparing for onchain payment of kind: {:?}", req.amount);
let (payer_amount_sat, receiver_amount_sat, total_fees_sat) = match req.amount {
PayOnchainAmount::Receiver { amount_sat } => {
let receiver_amount_sat = amount_sat;
Expand Down Expand Up @@ -1219,6 +1221,7 @@ impl LiquidSdk {
PaymentError::InsufficientFunds
);

info!("Prepared onchain payment: {res:?}");
Ok(res)
}

Expand All @@ -1243,6 +1246,7 @@ impl LiquidSdk {
req: &PayOnchainRequest,
) -> Result<SendPaymentResponse, PaymentError> {
self.ensure_is_started().await?;
info!("Paying onchain, request = {req:?}");

let balance_sat = self.get_info().await?.balance_sat;
let receiver_amount_sat = req.prepare_response.receiver_amount_sat;
Expand Down

0 comments on commit 4c2fcf6

Please sign in to comment.