From 459756815f9060691fef980270e89854929bf2ed Mon Sep 17 00:00:00 2001 From: Sosthene00 <674694@protonmail.ch> Date: Wed, 17 Apr 2024 08:18:33 +0200 Subject: [PATCH] abort if core doesn't have enough funds --- src/daemon.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/daemon.rs b/src/daemon.rs index 6720a0a..0e7d7a5 100644 --- a/src/daemon.rs +++ b/src/daemon.rs @@ -246,6 +246,10 @@ impl Daemon { .iter() .fold(Amount::from_sat(0), |acc, x| acc + x.amount); + if total_amt < FAUCET_AMT { + return Err(Error::msg("Not enought funds")); + } + let mut outputs = HashMap::new(); outputs.insert(address.to_string(), total_amt);