diff options
| author | Adam Soltys <[email protected]> | 2021-01-15 15:31:46 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2021-01-15 15:31:46 -0800 |
| commit | d01159ce9eee956dca32fd69525c0edd5aae9477 (patch) | |
| tree | e6a4d4a928daffb5bcedbc3411a0dfded6ff422f /lib/account.js | |
| parent | d03dad4d85ccd107068719c4b68cbd6a255864f6 (diff) | |
| download | coinos-server-d01159ce9eee956dca32fd69525c0edd5aae9477.tar.gz coinos-server-d01159ce9eee956dca32fd69525c0edd5aae9477.zip | |
add more transactions and locks
Diffstat (limited to 'lib/account.js')
| -rw-r--r-- | lib/account.js | 7 |
1 files changed, 4 insertions, 3 deletions
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 }); }; |
