From 1bb597211d4773615243259c6268d6e4f5ec0bae Mon Sep 17 00:00:00 2001 From: Tony Giorgio Date: Mon, 6 May 2024 18:27:10 -0500 Subject: [PATCH] Don't process estimated tx fee with a dust amt --- mutiny-core/src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mutiny-core/src/lib.rs b/mutiny-core/src/lib.rs index 483a10e6b..e13d5db94 100644 --- a/mutiny-core/src/lib.rs +++ b/mutiny-core/src/lib.rs @@ -150,6 +150,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 { @@ -1923,7 +1924,9 @@ impl MutinyWallet { amount: u64, fee_rate: Option, ) -> Result { - 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?;