mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-05-20 15:40:48 -04:00
Remove unnecessary state variables by constructing TXs on demand
This commit is contained in:
parent
e5c0158597
commit
84ea092a1b
4 changed files with 32 additions and 48 deletions
|
@ -59,7 +59,7 @@ pub async fn publish_cancel_transaction(
|
|||
cancel_timelock: CancelTimelock,
|
||||
tx_cancel_sig_bob: bitcoin::Signature,
|
||||
bitcoin_wallet: &bitcoin::Wallet,
|
||||
) -> Result<bitcoin::TxCancel> {
|
||||
) -> Result<()> {
|
||||
bitcoin_wallet
|
||||
.watch_until_status(tx_lock.txid(), tx_lock.script_pubkey(), |status| {
|
||||
status.is_confirmed_with(cancel_timelock)
|
||||
|
@ -81,7 +81,6 @@ pub async fn publish_cancel_transaction(
|
|||
let sig_b = tx_cancel_sig_bob.clone();
|
||||
|
||||
let tx_cancel = tx_cancel
|
||||
.clone()
|
||||
.add_signatures((a.public(), sig_a), (B, sig_b))
|
||||
.expect("sig_{a,b} to be valid signatures for tx_cancel");
|
||||
|
||||
|
@ -92,7 +91,7 @@ pub async fn publish_cancel_transaction(
|
|||
// block height
|
||||
}
|
||||
|
||||
Ok(tx_cancel)
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn wait_for_bitcoin_refund(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue