diff options
| author | Adam Soltys <[email protected]> | 2022-10-18 21:59:26 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-10-18 21:59:26 -0700 |
| commit | 924a5c33f3b9c76fcdb4a5787130e04bc56fd2bf (patch) | |
| tree | f928e100d091b26b1ec03808fa07933a50a8f178 /routes/liquid | |
| parent | 5e4015ccd47ca53c6b88c784a859227f03325c42 (diff) | |
| parent | 14b363bcfcfdd03f2232c2d0779ee90fc5cc27e6 (diff) | |
| download | coinos-server-924a5c33f3b9c76fcdb4a5787130e04bc56fd2bf.tar.gz coinos-server-924a5c33f3b9c76fcdb4a5787130e04bc56fd2bf.zip | |
Merge branch 'master' into prod
Diffstat (limited to 'routes/liquid')
| -rw-r--r-- | routes/liquid/receive.js | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/routes/liquid/receive.js b/routes/liquid/receive.js index 2f90af5e..718feba5 100644 --- a/routes/liquid/receive.js +++ b/routes/liquid/receive.js @@ -58,10 +58,8 @@ const getAccount = async (params, transaction) => { params.seed = nc.seed; } - const assets = assets; - - if (assets[asset]) { - ({ domain, ticker, precision, name } = assets[asset]); + if (store.assets[asset]) { + ({ domain, ticker, precision, name } = store.assets[asset]); } else { const existing = await db.Account.findOne({ where: { @@ -149,13 +147,14 @@ zmqRawTx.on("message", async (topic, message, sequence) => { let account = await db.Account.findOne({ where: { - id: invoice.account_id + id: invoice.account_id, + asset }, lock: transaction.LOCK.UPDATE, transaction }); - if (!(account && account.asset === asset)) { + if (!account) { let pubkey = account ? account.pubkey : null; account = await getAccount( @@ -371,13 +370,7 @@ setInterval(async () => { emit(user.username, "account", account); emit(user.username, "payment", p); - l( - "liquid confirmed", - user.username, - account.asset, - p.amount, - p.tip - ); + l("liquid confirmed", user.username, account.asset, p.amount, p.tip); notify(user, `${total} SAT payment confirmed`); callWebhook(p.invoice, p); |
