Skip to content

Commit

Permalink
fix(swaps): ensure taker payment spend confirmations (#2176)
Browse files Browse the repository at this point in the history
  • Loading branch information
shamardy authored and Alrighttt committed Aug 9, 2024
1 parent 619618a commit d756aa9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions mm2src/mm2_main/src/lp_swap/maker_swap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1144,14 +1144,16 @@ impl MakerSwap {
// we should wait for only one confirmation to make sure our spend transaction is not failed
let confirmations = std::cmp::min(1, self.r().data.taker_payment_confirmations);
let requires_nota = false;
let confirm_taker_payment_input = ConfirmPaymentInput {
payment_tx: self.r().taker_payment.clone().unwrap().tx_hex.0,
let confirm_taker_payment_spend_input = ConfirmPaymentInput {
payment_tx: self.r().taker_payment_spend.clone().unwrap().tx_hex.0,
confirmations,
requires_nota,
wait_until: self.wait_refund_until(),
check_every: WAIT_CONFIRM_INTERVAL_SEC,
};
let wait_fut = self.taker_coin.wait_for_confirmations(confirm_taker_payment_input);
let wait_fut = self
.taker_coin
.wait_for_confirmations(confirm_taker_payment_spend_input);
if let Err(err) = wait_fut.compat().await {
return Ok((Some(MakerSwapCommand::PrepareForMakerPaymentRefund), vec![
MakerSwapEvent::TakerPaymentSpendConfirmFailed(
Expand Down

0 comments on commit d756aa9

Please sign in to comment.