aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-08-23 18:54:13 -0400
committerAdam Soltys <[email protected]>2022-08-23 18:54:15 -0400
commit653d14e8f7b8bee93847f1d330ad1d38ac2ffddf (patch)
treeb5d4428b01ed1b60cd850074a2ad6ed47c47dc30
parent52de78167f0a9a4f28e06c8e4d2883305a6046d5 (diff)
downloadcoinos-server-653d14e8f7b8bee93847f1d330ad1d38ac2ffddf.tar.gz
coinos-server-653d14e8f7b8bee93847f1d330ad1d38ac2ffddf.zip
deduct fee before warning
-rw-r--r--lib/send.js3
1 files changed, 2 insertions, 1 deletions
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");
}