From 653d14e8f7b8bee93847f1d330ad1d38ac2ffddf Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 23 Aug 2022 18:54:13 -0400 Subject: deduct fee before warning --- lib/send.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/send.js') diff --git a/lib/send.js b/lib/send.js index 247ad9f5..414c7e3e 100644 --- a/lib/send.js +++ b/lib/send.js @@ -63,7 +63,8 @@ send = async (amount, memo, hash, user) => { conversionFee ); - if (!account || account.balance < amount + conversionFee) { + if (!account || account.balance < amount + conversionFee - conversionFeeDeduction) { + l.warn("user attempting to send more than they have", user.id, amount, conversionFee); throw new Error("Insufficient funds"); } -- cgit v1.2.3