aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/account.js7
1 files changed, 6 insertions, 1 deletions
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) {