Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions rs/dogecoin/ckdoge/minter/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use ic_cdk::{init, post_upgrade, query, update};
use ic_ckbtc_minter::reimbursement::InvalidTransactionError;
use ic_ckbtc_minter::state::eventlog::EventLogger;
use ic_ckbtc_minter::tasks::{TaskType, schedule_now};
use ic_ckbtc_minter::{BuildTxError, CanisterRuntime};
use ic_ckbtc_minter::{BuildTxError, CanisterRuntime, fees::FeeEstimator};
use ic_ckdoge_minter::candid_api::{EstimateWithdrawalFeeError, MinterInfo};
use ic_ckdoge_minter::event::CkDogeEventLogger;
use ic_ckdoge_minter::{
Expand Down Expand Up @@ -105,11 +105,16 @@ fn estimate_withdrawal_fee(
let fee_estimator = DOGECOIN_CANISTER_RUNTIME.fee_estimator(s);
let withdrawal_amount = arg.amount.unwrap_or(s.fee_based_retrieve_btc_min_amount);

let fee_rate = fee_estimator
.estimate_median_fee(&s.last_fee_per_vbyte)
.unwrap_or_else(|| {
s.last_median_fee_per_vbyte
.expect("Bitcoin current fee percentiles not retrieved yet.")
});
ic_ckdoge_minter::fees::estimate_retrieve_doge_fee(
&mut s.available_utxos,
withdrawal_amount,
s.last_median_fee_per_vbyte
.expect("Bitcoin current fee percentiles not retrieved yet."),
fee_rate,
s.max_num_inputs_in_transaction,
&fee_estimator,
)
Expand Down
Loading