mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-09-24 22:58:30 -04:00
Dynamically chose fee for TxRedeem.
Alice chooses the fee for TxRedeem because she 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
002e7b38c3
commit
d5c1b6693e
8 changed files with 57 additions and 8 deletions
|
@ -35,6 +35,11 @@ use tracing_subscriber::util::SubscriberInitExt;
|
|||
use url::Url;
|
||||
use uuid::Uuid;
|
||||
|
||||
// Note: this needs to be adopted if bitcoin::wallet.select_feerate() or
|
||||
// bitcoin::ESTIMATED_WEIGHT_TX_REDEEM changes.
|
||||
// TODO: see if there is a better way.
|
||||
const TX_REDEEM_FEE: u64 = 12500;
|
||||
|
||||
pub async fn setup_test<T, F, C>(_config: C, testfn: T)
|
||||
where
|
||||
T: Fn(TestContext) -> F,
|
||||
|
@ -678,7 +683,7 @@ impl TestContext {
|
|||
|
||||
fn alice_redeemed_btc_balance(&self) -> bitcoin::Amount {
|
||||
self.alice_starting_balances.btc + self.btc_amount
|
||||
- bitcoin::Amount::from_sat(bitcoind::TX_FEE)
|
||||
- bitcoin::Amount::from_sat(TX_REDEEM_FEE)
|
||||
}
|
||||
|
||||
fn bob_redeemed_xmr_balance(&self) -> monero::Amount {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue