From 5e5af205d9cbe9bb6c30f24b6d08e11bc2699a88 Mon Sep 17 00:00:00 2001 From: Judd Date: Fri, 1 Nov 2024 17:25:24 -0500 Subject: [PATCH] Account for fee in withdrawal validation --- src/bitcoin/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bitcoin/mod.rs b/src/bitcoin/mod.rs index 36db57e5..3941afcd 100644 --- a/src/bitcoin/mod.rs +++ b/src/bitcoin/mod.rs @@ -787,7 +787,7 @@ impl Bitcoin { ); } - let value = Into::::into(amount) / self.config.units_per_sat; + let value = (Into::::into(amount) - fee_amount) / self.config.units_per_sat; if value < self.config.min_withdrawal_amount { return Err(OrgaError::App( "Withdrawal is smaller than than the minimum amount".to_string(),