Skip to content

Commit

Permalink
Chain swap cooperative refund: fix "Liquid chain used for Bitcoin ope…
Browse files Browse the repository at this point in the history
…rations" error
  • Loading branch information
ok300 committed Oct 1, 2024
1 parent 6e34fee commit 8a325e3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/core/src/chain_swap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -819,8 +819,8 @@ impl ChainSwapHandler {

let bitcoin_chain_service = self.bitcoin_chain_service.lock().await;
let script_pk = swap_script
.to_address(self.config.network.into())
.map_err(|_| anyhow!("Could not retrieve address from swap script"))?
.to_address(self.config.network.as_bitcoin_chain())
.map_err(|e| anyhow!("Could not retrieve address from swap script: {e:?}"))?
.script_pubkey();
let utxos = bitcoin_chain_service.get_script_utxos(&script_pk).await?;

Expand All @@ -839,6 +839,7 @@ impl ChainSwapHandler {
),
});
};
debug!("Built refund tx: {refund_tx:?}");
let refund_tx_id = bitcoin_chain_service.broadcast(&refund_tx)?.to_string();

info!(
Expand Down

0 comments on commit 8a325e3

Please sign in to comment.