Skip to content

Commit

Permalink
Don't process estimated tx fee with a dust amt
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyGiorgio committed May 6, 2024
1 parent 2717423 commit 729125f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mutiny-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ const BITCOIN_PRICE_CACHE_SEC: u64 = 300;
const DEFAULT_PAYMENT_TIMEOUT: u64 = 30;
const SWAP_LABEL: &str = "SWAP";
const MELT_CASHU_TOKEN: &str = "Cashu Token Melt";
const DUST_LIMIT: u64 = 546;

#[cfg_attr(test, automock)]
pub trait InvoiceHandler {
Expand Down Expand Up @@ -1874,7 +1875,9 @@ impl<S: MutinyStorage> MutinyWallet<S> {
amount: u64,
fee_rate: Option<f32>,
) -> Result<u64, MutinyError> {
log_warn!(self.logger, "estimate_tx_fee");
if amount < DUST_LIMIT {
return Err(MutinyError::WalletOperationFailed);
}

// Try each federation first
let federation_ids = self.list_federation_ids().await?;
Expand Down

0 comments on commit 729125f

Please sign in to comment.