mirror of
https://github.com/RoboSats/taptrade-core.git
synced 2025-12-24 13:56:57 +00:00
fix errors
This commit is contained in:
@ -127,7 +127,10 @@ async fn submit_escrow_psbt(
|
||||
Err(RequestError::PsbtAlreadySubmitted) => {
|
||||
Ok(StatusCode::INTERNAL_SERVER_ERROR.into_response())
|
||||
}
|
||||
Err(RequestError::PsbtInvalid) => Ok(StatusCode::NOT_ACCEPTABLE.into_response()),
|
||||
Err(RequestError::PsbtInvalid(e)) => {
|
||||
warn!("Invalid PSBT: {e}");
|
||||
Ok(StatusCode::NOT_ACCEPTABLE.into_response())
|
||||
}
|
||||
_ => Ok(StatusCode::INTERNAL_SERVER_ERROR.into_response()),
|
||||
// Err(RequestError::NotFound) => {
|
||||
// info!("Offer for escrow psbt not found");
|
||||
@ -187,6 +190,10 @@ async fn submit_obligation_confirmation(
|
||||
error!("Database error fetching obligation confirmation: {e}");
|
||||
Ok(StatusCode::INTERNAL_SERVER_ERROR.into_response())
|
||||
}
|
||||
_ => {
|
||||
error!("Unknown error handling obligation confirmation");
|
||||
Ok(StatusCode::INTERNAL_SERVER_ERROR.into_response())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -212,6 +219,10 @@ async fn request_escrow(
|
||||
error!("Database error fetching obligation confirmation: {e}");
|
||||
Ok(StatusCode::INTERNAL_SERVER_ERROR.into_response())
|
||||
}
|
||||
_ => {
|
||||
error!("Unknown error handling request_escrow()");
|
||||
Ok(StatusCode::INTERNAL_SERVER_ERROR.into_response())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -240,6 +251,10 @@ async fn poll_final_payout(
|
||||
error!("Database error fetching final payout: {e}");
|
||||
Ok(StatusCode::INTERNAL_SERVER_ERROR.into_response())
|
||||
}
|
||||
_ => {
|
||||
error!("Unknown error handling poll_final_payout()");
|
||||
Ok(StatusCode::INTERNAL_SERVER_ERROR.into_response())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,11 +1,10 @@
|
||||
use super::*;
|
||||
use bdk::{
|
||||
bitcoin::psbt::Input,
|
||||
bitcoin::psbt::PartiallySignedTransaction,
|
||||
descriptor::Descriptor,
|
||||
miniscript::{descriptor::TapTree, policy::Concrete, Tap},
|
||||
SignOptions,
|
||||
};
|
||||
use bitcoin::psbt::PartiallySignedTransaction;
|
||||
use musig2::{secp256k1::PublicKey as MuSig2PubKey, KeyAggContext};
|
||||
|
||||
#[derive(Debug)]
|
||||
@ -237,13 +236,12 @@ impl<D: bdk::database::BatchDatabase> CoordinatorWallet<D> {
|
||||
let mut maker_psbt = PartiallySignedTransaction::from_str(signed_maker_psbt_hex)?;
|
||||
let taker_psbt = PartiallySignedTransaction::from_str(signed_taker_psbt_hex)?;
|
||||
|
||||
maker_psbt.combine(&taker_psbt)?;
|
||||
maker_psbt.combine(taker_psbt)?;
|
||||
|
||||
let wallet = self.wallet.lock().await;
|
||||
match wallet.finalize_psbt(&mut maker_psbt, SignOptions::default()) {
|
||||
Ok(true) => {
|
||||
let tx = maker_psbt.extract_tx();
|
||||
let tx_hex = tx.to_string();
|
||||
self.backend.broadcast(&tx)?;
|
||||
info!("Escrow transaction broadcasted: {}", tx.txid());
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user