add debug logs

This commit is contained in:
fbock
2024-08-07 10:40:59 +02:00
parent 6cb138484c
commit 201706d555

View File

@ -1,4 +1,5 @@
use super::*; use super::*;
use axum::routing::trace;
use bdk::{ use bdk::{
bitcoin::psbt::PartiallySignedTransaction, bitcoin::psbt::PartiallySignedTransaction,
descriptor::Descriptor, descriptor::Descriptor,
@ -233,10 +234,19 @@ impl<D: bdk::database::BatchDatabase> CoordinatorWallet<D> {
signed_maker_psbt_hex: &str, signed_maker_psbt_hex: &str,
signed_taker_psbt_hex: &str, signed_taker_psbt_hex: &str,
) -> Result<()> { ) -> Result<()> {
let mut maker_psbt = PartiallySignedTransaction::from_str(signed_maker_psbt_hex)?; trace!(
let taker_psbt = PartiallySignedTransaction::from_str(signed_taker_psbt_hex)?; "\n\n\nCombining and broadcasting escrow psbt.
signed maker psbt hex: {}, signed taker psbt hex: {}",
signed_maker_psbt_hex,
signed_taker_psbt_hex
);
let mut maker_psbt =
PartiallySignedTransaction::deserialize(&hex::decode(signed_maker_psbt_hex)?)?;
let taker_psbt =
PartiallySignedTransaction::deserialize(&hex::decode(signed_taker_psbt_hex)?)?;
maker_psbt.combine(taker_psbt)?; maker_psbt.combine(taker_psbt)?;
debug!("Combined escrow psbt: {:#?}", maker_psbt);
let wallet = self.wallet.lock().await; let wallet = self.wallet.lock().await;
match wallet.finalize_psbt(&mut maker_psbt, SignOptions::default()) { match wallet.finalize_psbt(&mut maker_psbt, SignOptions::default()) {