diff options
| author | Adam Soltys <[email protected]> | 2020-08-17 01:17:11 -0400 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2020-08-17 01:17:11 -0400 |
| commit | 5d2b15eef79c9c198719be50caa0aa2b35461431 (patch) | |
| tree | 7d17f62f9b984ad7d1b3bec9e7053b2ca940cd84 | |
| parent | 38b69d34f0f1d58565b4144035a1b9956f2cc87b (diff) | |
| download | coinos-server-5d2b15eef79c9c198719be50caa0aa2b35461431.tar.gz coinos-server-5d2b15eef79c9c198719be50caa0aa2b35461431.zip | |
create new liquid account properly
| -rw-r--r-- | routes/liquid/receive.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/routes/liquid/receive.js b/routes/liquid/receive.js index 325e6783..49c95712 100644 --- a/routes/liquid/receive.js +++ b/routes/liquid/receive.js @@ -17,7 +17,11 @@ const getAccount = async (params, pending) => { where: params }); - if (account) return account; + + if (account) { + l.info("found account", params, account.asset, account.id); + return account; + } let { asset } = params; let name = asset.substr(0, 6); @@ -33,12 +37,14 @@ const getAccount = async (params, pending) => { const existing = await db.Account.findOne({ where: { asset, + pubkey, }, order: [["id", "ASC"]], limit: 1, }); if (existing) { + l.info("existing", existing.id); ({ domain, ticker, precision, name } = existing); } } @@ -101,7 +107,7 @@ zmqRawTx.on("message", async (topic, message, sequence) => { account.pending += value; await account.save(); } else { - if (!account) account = await getAccount( + account = await getAccount( { user_id: user.id, asset, |
