mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-11-25 18:26:28 -05:00
Dynamically chose fee for TxCancel.
Bob chooses the fee for TxCancel because he is the one that cares.
This commit is contained in:
parent
1012e39527
commit
38540b4de5
8 changed files with 121 additions and 36 deletions
|
|
@ -67,6 +67,7 @@ async fn next_state(
|
|||
BobState::Started { btc_amount } => {
|
||||
let bitcoin_refund_address = bitcoin_wallet.new_address().await?;
|
||||
let tx_refund_fee = bitcoin_wallet.estimate_fee(bitcoin::ESTIMATED_WEIGHT_TX_REDEEM);
|
||||
let tx_cancel_fee = bitcoin_wallet.estimate_fee(bitcoin::ESTIMATED_WEIGHT_TX_CANCEL);
|
||||
|
||||
let state2 = request_price_and_setup(
|
||||
swap_id,
|
||||
|
|
@ -75,6 +76,7 @@ async fn next_state(
|
|||
env_config,
|
||||
bitcoin_refund_address,
|
||||
tx_refund_fee,
|
||||
tx_cancel_fee,
|
||||
)
|
||||
.await?;
|
||||
|
||||
|
|
@ -271,6 +273,7 @@ pub async fn request_price_and_setup(
|
|||
env_config: &Config,
|
||||
bitcoin_refund_address: bitcoin::Address,
|
||||
tx_refund_fee: bitcoin::Amount,
|
||||
tx_cancel_fee: bitcoin::Amount,
|
||||
) -> Result<bob::state::State2> {
|
||||
let xmr = event_loop_handle.request_spot_price(btc).await?;
|
||||
|
||||
|
|
@ -286,6 +289,7 @@ pub async fn request_price_and_setup(
|
|||
bitcoin_refund_address,
|
||||
env_config.monero_finality_confirmations,
|
||||
tx_refund_fee,
|
||||
tx_cancel_fee,
|
||||
);
|
||||
|
||||
let state2 = event_loop_handle.execution_setup(state0).await?;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue