mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-01-12 07:59:33 -05:00
Improve error messages when determining BTC amount to be swapped
This commit is contained in:
parent
4138039ea0
commit
1aa6d177bf
@ -313,14 +313,18 @@ async fn determine_btc_to_swap(
|
||||
bid_quote.max_quantity
|
||||
);
|
||||
|
||||
let new_balance = wait_for_deposit.await?;
|
||||
let new_balance = wait_for_deposit
|
||||
.await
|
||||
.context("Failed to wait for Bitcoin deposit")?;
|
||||
|
||||
info!("Received {}", new_balance);
|
||||
} else {
|
||||
info!("Found {} in wallet", initial_balance);
|
||||
}
|
||||
|
||||
let max_giveable = max_giveable.await?;
|
||||
let max_giveable = max_giveable
|
||||
.await
|
||||
.context("Failed to compute max 'giveable' Bitcoin amount")?;
|
||||
let max_accepted = bid_quote.max_quantity;
|
||||
|
||||
if max_giveable > max_accepted {
|
||||
|
@ -155,7 +155,7 @@ impl Wallet {
|
||||
tx_builder.set_single_recipient(dummy_script);
|
||||
tx_builder.drain_wallet();
|
||||
tx_builder.fee_rate(self.select_feerate());
|
||||
let (_, details) = tx_builder.finish()?;
|
||||
let (_, details) = tx_builder.finish().context("Failed to build transaction")?;
|
||||
|
||||
let max_giveable = details.sent - details.fees;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user