mirror of
https://github.com/RoboSats/taptrade-core.git
synced 2026-01-02 18:09:19 +00:00
fix maker psbt submission
This commit is contained in:
@ -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);
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user