Improve error messages when determining BTC amount to be swapped

pull/275/head
Thomas Eizinger 3 years ago
parent 4138039ea0
commit 1aa6d177bf
No known key found for this signature in database
GPG Key ID: 651AC83A6C6C8B96

@ -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…
Cancel
Save