mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-11-29 12:06:35 -05:00
Dynamically chose fee for TxRefund and TxPunish.
Alice chooses the fee for TxPunish because she is the one that cares. Bob chooses the fee for TxRefund because he is the one that cares. Note must be taken here because if the fee is too low (e.g. < min tx fee) then she might not be able to publish TxRedeem at all.
This commit is contained in:
parent
d5c1b6693e
commit
1012e39527
11 changed files with 101 additions and 30 deletions
|
|
@ -136,6 +136,7 @@ impl TxLock {
|
|||
&self,
|
||||
spend_address: &Address,
|
||||
sequence: Option<u32>,
|
||||
spending_fee: Amount,
|
||||
) -> Transaction {
|
||||
let previous_output = self.as_outpoint();
|
||||
|
||||
|
|
@ -147,7 +148,8 @@ impl TxLock {
|
|||
};
|
||||
|
||||
let tx_out = TxOut {
|
||||
value: self.inner.clone().extract_tx().output[self.lock_output_vout()].value - TX_FEE,
|
||||
value: self.inner.clone().extract_tx().output[self.lock_output_vout()].value
|
||||
- spending_fee.as_sat(),
|
||||
script_pubkey: spend_address.script_pubkey(),
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue