diff options
| author | Adam Soltys <[email protected]> | 2020-07-24 09:32:03 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2020-07-24 09:32:03 -0700 |
| commit | 35c62a7b75c47b89d229e2278b699e488c348d85 (patch) | |
| tree | e784c284236b3fc72c2c9417af09c546439bd2e6 /routes/liquid | |
| parent | a38b44306546af56f666add49842fedc25cb35e1 (diff) | |
| download | coinos-server-35c62a7b75c47b89d229e2278b699e488c348d85.tar.gz coinos-server-35c62a7b75c47b89d229e2278b699e488c348d85.zip | |
conduct swap from external acceptor
Diffstat (limited to 'routes/liquid')
| -rw-r--r-- | routes/liquid/receive.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/routes/liquid/receive.js b/routes/liquid/receive.js index 45419ecb..447a031f 100644 --- a/routes/liquid/receive.js +++ b/routes/liquid/receive.js @@ -100,7 +100,7 @@ zmqRawTx.on("message", async (topic, message, sequence) => { const currency = invoice ? invoice.currency : user.currency; const rate = invoice ? invoice.rate : app.get("rates")[user.currency]; const tip = invoice ? invoice.tip : 0; - const memo = invoice ? invoice.memo : ''; + const memo = invoice ? invoice.memo : ""; let payment = await db.Payment.create({ account_id: account.id, @@ -122,6 +122,7 @@ zmqRawTx.on("message", async (topic, message, sequence) => { payment.account = account.get({ plain: true }); emit(user.username, "payment", payment); + emit(user.username, "account", account); l.info("liquid detected", user.username, asset, value); notify(user, `${value} SAT payment detected`); } @@ -176,6 +177,9 @@ zmqRawBlock.on("message", async (topic, message, sequence) => { payment.confirmed = true; await payment.save({ transaction }); + payment = payment.get({ plain: true }); + payment.account = account.get({ plain: true }); + emit(user.username, "account", account); emit(user.username, "payment", payment); @@ -202,6 +206,9 @@ zmqRawBlock.on("message", async (topic, message, sequence) => { payment.confirmed = true; await payment.save({ transaction }); + payment = payment.get({ plain: true }); + payment.account = account.get({ plain: true }); + emit(user.username, "account", account); emit(user.username, "payment", payment); } |
