From d01159ce9eee956dca32fd69525c0edd5aae9477 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 15 Jan 2021 15:31:46 -0800 Subject: add more transactions and locks --- lib/account.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/account.js') diff --git a/lib/account.js b/lib/account.js index 5a8c3924..ac09a8e8 100644 --- a/lib/account.js +++ b/lib/account.js @@ -33,9 +33,10 @@ module.exports = async (asset, user, transaction) => { asset }, order: [["id", "ASC"]], - limit: 1 + limit: 1, + lock: transaction.LOCK.UPDATE, + transaction }, - { transaction } ); if (existing) { @@ -46,5 +47,5 @@ module.exports = async (asset, user, transaction) => { params = { ...params, ...{ domain, ticker, precision, name } }; params.balance = 0; params.pending = 0; - return db.Account.create(params); + return db.Account.create(params, { transaction }); }; -- cgit v1.2.3