Skip to content

Commit

Permalink
Don't wait for refund transaction to receive confirmations
Browse files Browse the repository at this point in the history
Don't wait for refund transaction to receive confirmations to mitigate a scenario where the swap is stuck in `BtcCancelled` because it's not resumable.
  • Loading branch information
binarybaron authored and andresmc1995 committed Apr 13, 2022
1 parent 59a62fa commit 38744b8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions swap/src/protocol/bob/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -659,8 +659,7 @@ impl State6 {

pub async fn publish_refund_btc(&self, bitcoin_wallet: &bitcoin::Wallet) -> Result<()> {
let signed_tx_refund = self.signed_refund_transaction()?;
let (_, subscription) = bitcoin_wallet.broadcast(signed_tx_refund, "refund").await?;
subscription.wait_until_final().await?;
bitcoin_wallet.broadcast(signed_tx_refund, "refund").await?;

Ok(())
}
Expand Down

0 comments on commit 38744b8

Please sign in to comment.