fix maker psbt submission

This commit is contained in:
Felix
2024-06-18 16:26:26 +00:00
parent bd8deb2b4c
commit 42424672ed
2 changed files with 4 additions and 4 deletions

View File

@ -35,12 +35,12 @@ impl ActiveOffer {
// polling until offer is taken, in production a more efficient way would make sense
// returns the PSBT of the escrow trade transaction we have to validate, sign and return
pub fn wait_until_taken(
self,
&self,
trader_config: &TraderSettings,
) -> Result<PartiallySignedTransaction> {
loop {
thread::sleep(Duration::from_secs(10));
if let Some(offer_taken_response) = OfferTakenResponse::check(&self, trader_config)? {
if let Some(offer_taken_response) = OfferTakenResponse::check(self, trader_config)? {
let psbt_bytes = hex::decode(offer_taken_response.trade_psbt_hex_to_sign)?;
let psbt = PartiallySignedTransaction::deserialize(&psbt_bytes)?;
return Ok(psbt);

View File

@ -7,7 +7,7 @@ use crate::{
cli::TraderSettings,
communication::api::{
BondRequirementResponse, BondSubmissionRequest, OfferTakenRequest, OfferTakenResponse,
PublicOffer, PublicOffers,
PsbtSubmissionRequest, PublicOffer, PublicOffers,
},
wallet::{
bond::Bond,
@ -38,7 +38,7 @@ pub fn run_maker(maker_config: &TraderSettings) -> Result<()> {
PsbtSubmissionRequest::submit_escrow_psbt(
&escrow_contract_psbt,
offer.offer_id_hex.clone(),
taker_config,
maker_config,
)?;
// wait for confirmation