From aa0a2e326c6ab928d10ce667b386d56505632887 Mon Sep 17 00:00:00 2001 From: Daniel Karzel Date: Thu, 3 Dec 2020 16:58:12 +1100 Subject: [PATCH] Change hardcoded bitcoin fee estimate to overpay by approx. 1.5 given current network rates --- xmr-btc/src/bitcoin.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/xmr-btc/src/bitcoin.rs b/xmr-btc/src/bitcoin.rs index 1cbb49f5..e1bd6868 100644 --- a/xmr-btc/src/bitcoin.rs +++ b/xmr-btc/src/bitcoin.rs @@ -14,7 +14,14 @@ pub use bitcoin::{util::psbt::PartiallySignedTransaction, *}; pub use ecdsa_fun::{adaptor::EncryptedSignature, fun::Scalar, Signature}; pub use transactions::{TxCancel, TxLock, TxPunish, TxRedeem, TxRefund}; -pub const TX_FEE: u64 = 10_000; + +// TODO: Configurable tx-fee (note: the parties have to agree on it prior to swapping) +// Current reasoning: +// tx with largest weight (as determined by get_weight() upon broadcast in e2e test) = 609 +// assuming segwit and 60 sat/vB: +// (609 / 4) * 60 (sat/vB) = 9135 sats +// Recommended: Overpay a bit to ensure we don't have to wait too long for test runs. +pub const TX_FEE: u64 = 15_000; #[derive(Debug, Clone, Deserialize, Serialize, PartialEq)] pub struct SecretKey {