From 0904ac984bb2aff0a862a0157f8f2feead1b1c83 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 17 Sep 2020 00:55:40 -0700 Subject: use current account for internal payments --- routes/send.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'routes/send.js') diff --git a/routes/send.js b/routes/send.js index aea0a858..e2836b82 100644 --- a/routes/send.js +++ b/routes/send.js @@ -10,14 +10,7 @@ module.exports = ah(async (req, res, next) => { try { await db.transaction(async transaction => { - let account = await db.Account.findOne({ - where: { - user_id: user.id, - asset - }, - lock: transaction.LOCK.UPDATE, - transaction - }); + let { account } = user; if (account.balance < amount) { throw new Error("Insufficient funds"); @@ -149,7 +142,6 @@ module.exports = ah(async (req, res, next) => { user.username, user.balance, e.message, - e.stack ); return res.status(500).send(e.message); } -- cgit v1.2.3