Add relative and absolute max transaction fee.

This commit is contained in:
Philipp Hoenisch 2021-05-04 11:34:00 +10:00
parent dc6ab0fa52
commit dc8dd5af28
No known key found for this signature in database
GPG key ID: E5F8E74C672BC666
5 changed files with 168 additions and 46 deletions

View file

@ -66,8 +66,12 @@ async fn next_state(
Ok(match state {
BobState::Started { btc_amount } => {
let bitcoin_refund_address = bitcoin_wallet.new_address().await?;
let tx_refund_fee = bitcoin_wallet.estimate_fee(TxRefund::weight()).await?;
let tx_cancel_fee = bitcoin_wallet.estimate_fee(TxCancel::weight()).await?;
let tx_refund_fee = bitcoin_wallet
.estimate_fee(TxRefund::weight(), btc_amount)
.await?;
let tx_cancel_fee = bitcoin_wallet
.estimate_fee(TxCancel::weight(), btc_amount)
.await?;
let state2 = request_price_and_setup(
swap_id,