mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-05-20 15:40:48 -04:00
Avoid possible mix up between timelocks
Introduce new type to ensure no mix up happens when ordering the fields in function calls.
This commit is contained in:
parent
9a321a4f09
commit
b8a84aa34b
12 changed files with 121 additions and 104 deletions
|
@ -1,9 +1,8 @@
|
|||
use crate::{
|
||||
bitcoin,
|
||||
bitcoin::{
|
||||
poll_until_block_height_is_gte,
|
||||
timelocks::{BlockHeight, Timelock},
|
||||
BroadcastSignedTransaction, EncryptedSignature, GetBlockHeight, GetRawTransaction,
|
||||
poll_until_block_height_is_gte, BlockHeight, BroadcastSignedTransaction, CancelTimelock,
|
||||
EncryptedSignature, GetBlockHeight, GetRawTransaction, PunishTimelock,
|
||||
TransactionBlockHeight, TxCancel, TxLock, TxRefund, WaitForTransactionFinality,
|
||||
WatchForRawTransaction,
|
||||
},
|
||||
|
@ -151,7 +150,7 @@ pub async fn publish_cancel_transaction<W>(
|
|||
tx_lock: TxLock,
|
||||
a: bitcoin::SecretKey,
|
||||
B: bitcoin::PublicKey,
|
||||
cancel_timelock: Timelock,
|
||||
cancel_timelock: CancelTimelock,
|
||||
tx_cancel_sig_bob: bitcoin::Signature,
|
||||
bitcoin_wallet: Arc<W>,
|
||||
) -> Result<bitcoin::TxCancel>
|
||||
|
@ -198,7 +197,7 @@ where
|
|||
pub async fn wait_for_bitcoin_refund<W>(
|
||||
tx_cancel: &TxCancel,
|
||||
cancel_tx_height: BlockHeight,
|
||||
punish_timelock: Timelock,
|
||||
punish_timelock: PunishTimelock,
|
||||
refund_address: &bitcoin::Address,
|
||||
bitcoin_wallet: Arc<W>,
|
||||
) -> Result<(bitcoin::TxRefund, Option<bitcoin::Transaction>)>
|
||||
|
@ -250,9 +249,9 @@ pub fn extract_monero_private_key(
|
|||
|
||||
pub fn build_bitcoin_punish_transaction(
|
||||
tx_lock: &TxLock,
|
||||
cancel_timelock: Timelock,
|
||||
cancel_timelock: CancelTimelock,
|
||||
punish_address: &bitcoin::Address,
|
||||
punish_timelock: Timelock,
|
||||
punish_timelock: PunishTimelock,
|
||||
tx_punish_sig_bob: bitcoin::Signature,
|
||||
a: bitcoin::SecretKey,
|
||||
B: bitcoin::PublicKey,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue