examples: exit if balance < SEND_AMOUNT

This commit is contained in:
Daniela Brozzoni committed 2023-03-08 15:41:49 +01:00
1 parent 47faa881fb
commit 0aaf420f6d
2 files changed
+10 -4

No files matched your search

+5 -2
View File
@@ -77,8 +77,11 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let balance = wallet.get_balance();
println!("Wallet balance after syncing: {} sats", balance.total());
if balance.total() == 0 {
println!("Please send some coins to the receiving address");
if balance.total() < SEND_AMOUNT {
println!(
"Please send at least {} sats to the receiving address",
SEND_AMOUNT
);
std::process::exit(0);
}