mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-06-06 22:29:05 -04:00
Ensure that constant weights do not go out of sync with code.
This commit is contained in:
parent
7fe9087bc2
commit
dc6ab0fa52
11 changed files with 182 additions and 52 deletions
|
@ -646,7 +646,15 @@ impl State6 {
|
|||
Ok(tx_id)
|
||||
}
|
||||
|
||||
pub async fn refund_btc(&self, bitcoin_wallet: &bitcoin::Wallet) -> Result<()> {
|
||||
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?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn signed_refund_transaction(&self) -> Result<Transaction> {
|
||||
let tx_cancel = bitcoin::TxCancel::new(
|
||||
&self.tx_lock,
|
||||
self.cancel_timelock,
|
||||
|
@ -665,12 +673,7 @@ impl State6 {
|
|||
|
||||
let signed_tx_refund =
|
||||
tx_refund.add_signatures((self.A, sig_a), (self.b.public(), sig_b))?;
|
||||
|
||||
let (_, subscription) = bitcoin_wallet.broadcast(signed_tx_refund, "refund").await?;
|
||||
|
||||
subscription.wait_until_final().await?;
|
||||
|
||||
Ok(())
|
||||
Ok(signed_tx_refund)
|
||||
}
|
||||
|
||||
pub fn tx_lock_id(&self) -> bitcoin::Txid {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue