Skip to content

Commit

Permalink
Merge pull request #74 from hydra-yse/yse-fee-calculation
Browse files Browse the repository at this point in the history
Use minimum possible dummy fees to estimate transaction size
  • Loading branch information
i5hi authored Oct 24, 2024
2 parents 8d01611 + 09710fb commit e30a43f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/swaps/bitcoin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,7 @@ impl BtcSwapTx {
/// Use this before calling drain to help calculate the absolute fees.
/// Multiply the size by the fee_rate to get the absolute fees.
pub fn size(&self, keys: &Keypair, preimage: &Preimage) -> Result<usize, Error> {
let dummy_abs_fee = 5_000;
let dummy_abs_fee = 0;
// Can only calculate non-coperative claims
let tx = match self.kind {
SwapTxKind::Claim => self.sign_claim(keys, preimage, dummy_abs_fee, None)?,
Expand Down
2 changes: 1 addition & 1 deletion src/swaps/liquid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1212,7 +1212,7 @@ impl LBtcSwapTx {
/// Use this before calling drain to help calculate the absolute fees.
/// Multiply the size by the fee_rate to get the absolute fees.
pub fn size(&self, keys: &Keypair, preimage: &Preimage) -> Result<usize, Error> {
let dummy_abs_fee = Amount::from_sat(5_000);
let dummy_abs_fee = Amount::from_sat(0);
let tx = match self.kind {
SwapTxKind::Claim => self.sign_claim(keys, preimage, dummy_abs_fee, None)?, // TODO: Hardcode cooperative spend size
SwapTxKind::Refund => self.sign_refund(keys, dummy_abs_fee, None)?,
Expand Down

0 comments on commit e30a43f

Please sign in to comment.