aboutsummaryrefslogtreecommitdiffstats
path: root/routes/payments.js
diff options
context:
space:
mode:
Diffstat (limited to 'routes/payments.js')
-rw-r--r--routes/payments.js9
1 files changed, 4 insertions, 5 deletions
diff --git a/routes/payments.js b/routes/payments.js
index c09fcf93..b8999f55 100644
--- a/routes/payments.js
+++ b/routes/payments.js
@@ -35,10 +35,9 @@ catchUp();
export default {
async create({ body, user }, res) {
- let { amount, hash, maxfee, name, memo, payreq, username } = body;
+ let { amount, hash, maxfee, name, memo, payreq, username } = body;
try {
-
amount = parseInt(amount);
maxfee = maxfee ? parseInt(maxfee) : 0;
@@ -414,10 +413,10 @@ export default {
for (let pid of payments) {
let p = await g(`payment:${pid}`);
total += p.amount;
- if (p.amount < 0) total -= ((p.fee || 0) + (p.ourfee || 0));
- }
+ if (p.amount < 0) total -= (p.fee || 0) + (p.ourfee || 0);
+ }
- l('corrected balance', username, uid, balance, total);
+ l("corrected balance", username, uid, balance, total);
await s(`balance:${uid}`, total);
res.send("ok");
} catch (e) {