Skip to content

Commit

Permalink
Consolidate reverse swap onchain amount arg
Browse files Browse the repository at this point in the history
  • Loading branch information
ok300 committed Mar 23, 2024
1 parent d906e87 commit 1324935
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/src/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ impl Wallet {
err: "Both invoice and onchain amounts were specified".into(),
}),
}?;
debug!("Creating reverse swap with: onchain_amount_sat {onchain_amount_sat} sat, invoice_amount_sat {invoice_amount_sat} sat");

lbtc_pair
.limits
Expand Down Expand Up @@ -357,12 +358,7 @@ impl Wallet {
blinding_key: blinding_str,
redeem_script,
invoice_amount_sat,
onchain_amount_sat: req.onchain_amount_sat.unwrap_or(
invoice_amount_sat
- lbtc_pair.fees.reverse_boltz(invoice_amount_sat)?
- lbtc_pair.fees.reverse_lockup()?
- CLAIM_ABSOLUTE_FEES
),
onchain_amount_sat,
}]))
.map_err(|_| SwapError::PersistError)?;

Expand Down

0 comments on commit 1324935

Please sign in to comment.