From 072dd8dcce4f28eba78838855f6ae977b868c8b6 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 24 Sep 2020 23:49:37 -0700 Subject: order matching --- lib/account.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/account.js b/lib/account.js index 27ef830a..ca3ce7ea 100644 --- a/lib/account.js +++ b/lib/account.js @@ -1,11 +1,14 @@ const axios = require("axios"); -module.exports = async (asset, user) => { +module.exports = async (asset, user, transaction) => { const account = await db.Account.findOne({ where: { user_id: user.id, asset, + pubkey: null, }, + lock: transaction.LOCK.UPDATE, + transaction, }); if (account) return account; @@ -30,6 +33,8 @@ module.exports = async (asset, user) => { }, order: [["id", "ASC"]], limit: 1, + lock: transaction.LOCK.UPDATE, + transaction, }); if (existing) { -- cgit v1.2.3